]> git.ipfire.org Git - ipfire-3.x.git/blame - telnet/patches/telnetd-0.17-pty_read.patch0
git: Update to 2.23.0
[ipfire-3.x.git] / telnet / patches / telnetd-0.17-pty_read.patch0
CommitLineData
6f01057b
JPT
1--- telnetd/telnetd.c 2005-01-19 14:37:25.000000000 +0000
2+++ telnetd/telnetd.c.new 2005-01-19 14:48:12.000000000 +0000
3@@ -697,6 +697,7 @@
4 int on = 1;
5 char *HE;
6 const char *IM;
7+ int pty_read_ok = 0; /* track whether the pty read has worked yet */
8
9 /*
10 * Initialize the slc mapping table.
11@@ -1016,12 +1017,13 @@
12 * off the master side before the slave side is
13 * opened, we get EIO.
14 */
15- if (pcc < 0 && (errno == EWOULDBLOCK || errno == EIO)) {
16+ if (pcc < 0 && (errno == EWOULDBLOCK || (errno == EIO && pty_read_ok == 0))) {
17 pcc = 0;
18 }
19 else {
20 if (pcc <= 0)
21 break;
22+ pty_read_ok = 1; /* mark connection up for read */
23 #ifdef LINEMODE
24 /*
25 * If ioctl from pty, pass it through net