delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/11/08/21:04:19

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Wed, 8 Nov 2000 21:01:27 -0500
From: Christopher Faylor <cgf AT redhat DOT com>
To: cygwin AT sources DOT redhat DOT com
Subject: Re: PATCH: (sort of) RE: Possible bug with select and master side of pty
Message-ID: <20001108210126.A3325@redhat.com>
Reply-To: cygwin AT sources DOT redhat DOT com
Mail-Followup-To: cygwin AT sources DOT redhat DOT com
References: <20001108110537 DOT I17097 AT redhat DOT com> <001a01c049b6$07993310$21c9ca95 AT mow DOT siemens DOT ru>
Mime-Version: 1.0
User-Agent: Mutt/1.3.6i
In-Reply-To: <001a01c049b6$07993310$21c9ca95@mow.siemens.ru>; from Andrej.Borsenkow@mow.siemens.ru on Wed, Nov 08, 2000 at 09:59:32PM +0300

On Wed, Nov 08, 2000 at 09:59:32PM +0300, Andrej Borsenkow wrote:
>>
>> It may be a real problem and I appreciate your attempts to track it
>> down but since this seems to be working fine for the vast majority of
>> things which use the pty, I don't think I'll be fixing it any time soon.
>>
>> If someone else would like to take a stab at this (hah?) that would be
>> swell.
>>
>
>Attached is the half-hearted patch against 1.1.5-4 (relative to
>winsup/cygwin). The problem happens when someone reads from master side of pty
>using 1 byte buffer and onlcr is enabled. In this case read gets CR and
>appears to hang after that before it gets NL. It looks, like it "hangs" at the
>end of line. The same problem seems to be with select after CR was read - it
>thinks, no input is available.
>
>Forgive me my horrible c++; I still do not quite understand all these
>inheritance isuues. But the patch appears to work.

This patch looks pretty good and helped me enormously in understanding what
was going on.  After studying your patch and looking at the code a little,
I decided to go another way.

I just broke out the test in peek_pipe which was already checking for a pty
master and added the need_nl test there.  Your patch is more strictly correct
since it properly uses C++ inheritance to handle this rather than use an
if test but since the if test was already there, I decided to just go with
that (actually, I rewrote it to be a switch statement).

At some point, I'd like to use cygwin's typeahead handling for dealing
with this and get rid of the need_nl stuff.  At that point we would be
back to using the same peek_pipe function, so I'd rather not disturb
stuff too much right now.

Could you test out the patch below and let me know if it works for you?

This will be in tonight's snapshot and in the new cygwin 1.1.5-6 test
release.

Thanks again for taking the time to track this down and develop a patch.
I really appreciate it.

cgf

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019