diff options
| author | Richard M. Stallman | 1997-06-23 02:39:44 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-06-23 02:39:44 +0000 |
| commit | 498545661afb521e84a57bcf7066186c357803c5 (patch) | |
| tree | d78cd0e1db2a9d20c7bea11f12bd8117c6628d3b /src | |
| parent | a5f32ce4b55241fb0dc9fb621bb134d018207251 (diff) | |
| download | emacs-498545661afb521e84a57bcf7066186c357803c5.tar.gz emacs-498545661afb521e84a57bcf7066186c357803c5.zip | |
(read_avail_input): Check for failure with EIO.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 7 |
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) | |||
| 4924 | #else | 4924 | #else |
| 4925 | nread = read (input_fd, cbuf, n_to_read); | 4925 | nread = read (input_fd, cbuf, n_to_read); |
| 4926 | #endif | 4926 | #endif |
| 4927 | /* POSIX infers that processes which are not in the session leader's | ||
| 4928 | process group won't get SIGHUP's at logout time. BSDI adheres to | ||
| 4929 | this part standard and returns -1 from read(0) with errno==EIO | ||
| 4930 | when the control tty is taken away. | ||
| 4931 | Jeffrey Honig <jch@bsdi.com> says this is generally safe. */ | ||
| 4932 | if (nread == -1 && errno == EIO) | ||
| 4933 | kill (0, SIGHUP); | ||
| 4927 | #if defined (AIX) && (! defined (aix386) && defined (_BSD)) | 4934 | #if defined (AIX) && (! defined (aix386) && defined (_BSD)) |
| 4928 | /* The kernel sometimes fails to deliver SIGHUP for ptys. | 4935 | /* The kernel sometimes fails to deliver SIGHUP for ptys. |
| 4929 | This looks incorrect, but it isn't, because _BSD causes | 4936 | This looks incorrect, but it isn't, because _BSD causes |