# HG changeset patch # User Richard M. Stallman # Date 867033584 0 # Node ID 4eaaff49a24e6a4e24b2490431ffe78c3a27edc4 # Parent 2af2dc0cd97f33834bba272a4d3b1aaa6add1cc0 (read_avail_input): Check for failure with EIO. diff -r 2af2dc0cd97f -r 4eaaff49a24e src/keyboard.c --- a/src/keyboard.c Mon Jun 23 02:30:36 1997 +0000 +++ b/src/keyboard.c Mon Jun 23 02:39:44 1997 +0000 @@ -4924,6 +4924,13 @@ #else nread = read (input_fd, cbuf, n_to_read); #endif + /* POSIX infers that processes which are not in the session leader's + process group won't get SIGHUP's at logout time. BSDI adheres to + this part standard and returns -1 from read(0) with errno==EIO + when the control tty is taken away. + Jeffrey Honig says this is generally safe. */ + if (nread == -1 && errno == EIO) + kill (0, SIGHUP); #if defined (AIX) && (! defined (aix386) && defined (_BSD)) /* The kernel sometimes fails to deliver SIGHUP for ptys. This looks incorrect, but it isn't, because _BSD causes