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