Blame SOURCES/telnetd-0.17-pty_read.patch

ce2f68
--- telnetd/telnetd.c	2005-01-19 14:37:25.000000000 +0000
ce2f68
+++ telnetd/telnetd.c.new	2005-01-19 14:48:12.000000000 +0000
ce2f68
@@ -697,6 +697,7 @@
ce2f68
     int on = 1;
ce2f68
     char *HE;
ce2f68
     const char *IM;
ce2f68
+    int pty_read_ok = 0; /* track whether the pty read has worked yet */
ce2f68
 
ce2f68
     /*
ce2f68
      * Initialize the slc mapping table.
ce2f68
@@ -1016,12 +1017,13 @@
ce2f68
 	     * off the master side before the slave side is
ce2f68
 	     * opened, we get EIO.
ce2f68
 	     */
ce2f68
-	    if (pcc < 0 && (errno == EWOULDBLOCK || errno == EIO)) {
ce2f68
+	    if (pcc < 0 && (errno == EWOULDBLOCK || (errno == EIO && pty_read_ok == 0))) {
ce2f68
 		pcc = 0;
ce2f68
 	    } 
ce2f68
 	    else {
ce2f68
 		if (pcc <= 0)
ce2f68
 		    break;
ce2f68
+		pty_read_ok = 1;	/* mark connection up for read */
ce2f68
 #ifdef	LINEMODE
ce2f68
 				/*
ce2f68
 				 * If ioctl from pty, pass it through net