diff options
| author | Paul Eggert | 2013-07-12 07:31:42 -0700 |
|---|---|---|
| committer | Paul Eggert | 2013-07-12 07:31:42 -0700 |
| commit | 7e649856bce883738622cc3533ad808c6ea1a73f (patch) | |
| tree | 7f5d1f3fffd1b0097ba8fa4e8cbbb2a0d100b6bc /src/process.c | |
| parent | acfcc8c53bcfca52f4ab4ff527d39533545566d9 (diff) | |
| download | emacs-7e649856bce883738622cc3533ad808c6ea1a73f.tar.gz emacs-7e649856bce883738622cc3533ad808c6ea1a73f.zip | |
Minor EBADF fixes.
* process.c (create_process, wait_reading_process_output) [AIX]:
Remove obsolete SIGHUP-related code, as Emacs no longer disables
SIGHUP, so EBADF is no longer acceptable here (it wouldn't work in
a multithreaded environment anyway).
* sysdep.c (emacs_close): It's not dangerous to invoke emacs_close (-1).
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/src/process.c b/src/process.c index bdab1f8cb8a..81be29082fc 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -1812,12 +1812,6 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) | |||
| 1812 | SETUP_SLAVE_PTY; | 1812 | SETUP_SLAVE_PTY; |
| 1813 | } | 1813 | } |
| 1814 | #endif /* SETUP_SLAVE_PTY */ | 1814 | #endif /* SETUP_SLAVE_PTY */ |
| 1815 | #ifdef AIX | ||
| 1816 | /* On AIX, we've disabled SIGHUP above once we start a child on a pty. | ||
| 1817 | Now reenable it in the child, so it will die when we want it to. */ | ||
| 1818 | if (pty_flag) | ||
| 1819 | signal (SIGHUP, SIG_DFL); | ||
| 1820 | #endif | ||
| 1821 | #endif /* HAVE_PTYS */ | 1815 | #endif /* HAVE_PTYS */ |
| 1822 | 1816 | ||
| 1823 | signal (SIGINT, SIG_DFL); | 1817 | signal (SIGINT, SIG_DFL); |
| @@ -4632,20 +4626,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 4632 | if (xerrno == EINTR) | 4626 | if (xerrno == EINTR) |
| 4633 | no_avail = 1; | 4627 | no_avail = 1; |
| 4634 | else if (xerrno == EBADF) | 4628 | else if (xerrno == EBADF) |
| 4635 | { | 4629 | emacs_abort (); |
| 4636 | #ifdef AIX | ||
| 4637 | /* AIX doesn't handle PTY closure the same way BSD does. On AIX, | ||
| 4638 | the child's closure of the pts gives the parent a SIGHUP, and | ||
| 4639 | the ptc file descriptor is automatically closed, | ||
| 4640 | yielding EBADF here or at select() call above. | ||
| 4641 | So, SIGHUP is ignored (see def of PTY_TTY_NAME_SPRINTF | ||
| 4642 | in m/ibmrt-aix.h), and here we just ignore the select error. | ||
| 4643 | Cleanup occurs c/o status_notify after SIGCHLD. */ | ||
| 4644 | no_avail = 1; /* Cannot depend on values returned */ | ||
| 4645 | #else | ||
| 4646 | emacs_abort (); | ||
| 4647 | #endif | ||
| 4648 | } | ||
| 4649 | else | 4630 | else |
| 4650 | error ("select error: %s", emacs_strerror (xerrno)); | 4631 | error ("select error: %s", emacs_strerror (xerrno)); |
| 4651 | } | 4632 | } |