delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/11/08/14:03:08

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
X-Envelope-Sender-Is: Andrej DOT Borsenkow AT mow DOT siemens DOT ru (at relayer david.siemens.de)
From: "Andrej Borsenkow" <Andrej DOT Borsenkow AT mow DOT siemens DOT ru>
To: <cygwin AT sources DOT redhat DOT com>
Subject: PATCH: (sort of) RE: Possible bug with select and master side of pty
Date: Wed, 8 Nov 2000 21:59:32 +0300
Message-ID: <001a01c049b6$07993310$21c9ca95@mow.siemens.ru>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
In-Reply-To: <20001108110537.I17097@redhat.com>

------=_NextPart_000_001B_01C049CF.2CE66B10
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

>
> 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.

-andrej

------=_NextPart_000_001B_01C049CF.2CE66B10
Content-Type: application/octet-stream;
	name="cygwin-select.diff"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="cygwin-select.diff"

--- fhandler.h.org	Wed Nov  1 08:14:24 2000=0A=
+++ fhandler.h	Wed Nov  8 21:17:51 2000=0A=
@@ -720,6 +720,8 @@=0A=
 =0A=
   void set_close_on_exec (int val);=0A=
   BOOL hit_eof ();=0A=
+  select_record *select_read (select_record *s);=0A=
+  int ready_for_read (int fd, DWORD howlong, int ignra);=0A=
 };=0A=
 =0A=
 class fhandler_tty_master: public fhandler_pty_master=0A=
--- select.cc.org	Tue Oct 10 03:00:52 2000=0A=
+++ select.cc	Wed Nov  8 21:47:09 2000=0A=
@@ -726,6 +726,30 @@=0A=
 }=0A=
 =0A=
 select_record *=0A=
+fhandler_pty_master::select_read (select_record *s)=0A=
+{=0A=
+  if (need_nl) {=0A=
+      if (!s)=0A=
+	{=0A=
+	  s =3D new select_record;=0A=
+	  s->startup =3D no_startup;=0A=
+	  s->poll =3D set_bits;=0A=
+	  s->verify =3D no_verify;=0A=
+	}=0A=
+      s->h =3D get_handle ();=0A=
+      s->read_selected =3D TRUE;=0A=
+      return s;=0A=
+  } else=0A=
+    return fhandler_tty_common::select_read(s);=0A=
+}=0A=
+=0A=
+int=0A=
+fhandler_pty_master::ready_for_read (int fd, DWORD howlong, int ignra)=0A=
+{=0A=
+  return need_nl ? 1 : fhandler_tty_common::ready_for_read (fd, =
howlong, ignra);=0A=
+}=0A=
+=0A=
+select_record *=0A=
 fhandler_dev_null::select_read (select_record *s)=0A=
 {=0A=
   if (!s)=0A=


------=_NextPart_000_001B_01C049CF.2CE66B10
Content-Type: text/plain; charset=us-ascii

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
------=_NextPart_000_001B_01C049CF.2CE66B10--

- Raw text -


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