summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-06-23 02:39:44 +0000
committerRichard M. Stallman <rms@gnu.org>1997-06-23 02:39:44 +0000
commit498545661afb521e84a57bcf7066186c357803c5 (patch)
treed78cd0e1db2a9d20c7bea11f12bd8117c6628d3b /src
parenta5f32ce4b55241fb0dc9fb621bb134d018207251 (diff)
downloademacs-498545661afb521e84a57bcf7066186c357803c5.tar.gz
(read_avail_input): Check for failure with EIO.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 50f20d639fd..0303ab4fa65 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -4924,6 +4924,13 @@ read_avail_input (expected)
#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 <jch@bsdi.com> 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