PATCH: (sort of) RE: Possible bug with select and master side of pty

Christopher Faylor cgf@redhat.com
Wed Nov 8 18:02:00 GMT 2000


On Wed, Nov 08, 2000 at 09:01:26PM -0500, Christopher Faylor wrote:
>Could you test out the patch below and let me know if it works for you?

It would be nice for me to include the patch when I suggest stuff like this.

cgf

Wed Nov  8 21:00:31 2000  Christopher Faylor <cgf@cygnus.com>

        * select.cc (peek_pipe): Deal with pending newline in pty_master.

Index: select.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/select.cc,v
retrieving revision 1.27
diff -u -p -r1.27 select.cc
--- select.cc	2000/09/08 03:12:13	1.27
+++ select.cc	2000/11/09 01:57:26
@@ -418,12 +418,23 @@ peek_pipe (select_record *s, int ignra)
 	  goto out;
 	}
 
-      if (!ignra && fh->get_device () != FH_PTYM && fh->get_device () != FH_TTYM &&
-	  fh->get_readahead_valid ())
+      switch (fh->get_device ())
 	{
-	  select_printf ("readahead");
-	  gotone = s->read_ready = 1;
-	  goto out;
+	case FH_PTYM:
+	case FH_TTYM:
+	  if (((fhandler_pty_master *)fh)->need_nl)
+	    {
+	      gotone = s->read_ready = 1;
+	      goto out;
+	    }
+	  break;
+	default:
+	  if (!ignra && fh->get_readahead_valid ())
+	    {
+	      select_printf ("readahead");
+	      gotone = s->read_ready = 1;
+	      goto out;
+	    }
 	}
     }
 

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list