Fix to not go into loop if tty disappears
authorGregory Minshall <minshall@ucbvax.Berkeley.EDU>
Fri, 8 Jan 1988 03:17:08 +0000 (19:17 -0800)
committerGregory Minshall <minshall@ucbvax.Berkeley.EDU>
Fri, 8 Jan 1988 03:17:08 +0000 (19:17 -0800)
(from Rick Adams <rick@seismo.css.gov>).

SCCS-vsn: usr.bin/telnet/sys_bsd.c 1.8

usr/src/usr.bin/telnet/sys_bsd.c

index 65f1e12..b8f11c1 100644 (file)
@@ -576,7 +576,7 @@ int poll;           /* If 0, then block until something to do */
            c = 0;
        } else {
            /* EOF detection for line mode!!!! */
            c = 0;
        } else {
            /* EOF detection for line mode!!!! */
-           if (c == 0 && MODE_LOCAL_CHARS(globalmode)) {
+           if ((c == 0) && MODE_LOCAL_CHARS(globalmode) && isatty(tin)) {
                        /* must be an EOF... */
                *ttyiring.supply = termEofChar;
                c = 1;
                        /* must be an EOF... */
                *ttyiring.supply = termEofChar;
                c = 1;