diff options
| author | Miles Bader | 2007-03-21 13:33:07 +0000 |
|---|---|---|
| committer | Miles Bader | 2007-03-21 13:33:07 +0000 |
| commit | d85d38392e338f66053a6a6f1017720660239338 (patch) | |
| tree | e21e084051805db8c4035bc3a01ab7a41e09595f /src/process.c | |
| parent | 48ff183eab79714fb08df0961484a27052253585 (diff) | |
| parent | 815b81c8f205562b9d920fc95448924d130e2ab4 (diff) | |
| download | emacs-d85d38392e338f66053a6a6f1017720660239338.tar.gz emacs-d85d38392e338f66053a6a6f1017720660239338.zip | |
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 670-674)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 209-210)
- Merge from emacs--devo--0
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-185
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 53 |
1 files changed, 32 insertions, 21 deletions
diff --git a/src/process.c b/src/process.c index f3162c9d3e5..ad637ad6cfa 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -816,7 +816,7 @@ nil, indicating the current buffer's process. */) | |||
| 816 | Lisp_Object symbol; | 816 | Lisp_Object symbol; |
| 817 | /* Assignment to EMACS_INT stops GCC whining about limited range | 817 | /* Assignment to EMACS_INT stops GCC whining about limited range |
| 818 | of data type. */ | 818 | of data type. */ |
| 819 | EMACS_INT pid = p->pid;; | 819 | EMACS_INT pid = p->pid; |
| 820 | 820 | ||
| 821 | /* No problem storing the pid here, as it is still in Vprocess_alist. */ | 821 | /* No problem storing the pid here, as it is still in Vprocess_alist. */ |
| 822 | deleted_pid_list = Fcons (make_fixnum_or_float (pid), | 822 | deleted_pid_list = Fcons (make_fixnum_or_float (pid), |
| @@ -829,7 +829,8 @@ nil, indicating the current buffer's process. */) | |||
| 829 | if (CONSP (p->status)) | 829 | if (CONSP (p->status)) |
| 830 | symbol = XCAR (p->status); | 830 | symbol = XCAR (p->status); |
| 831 | if (EQ (symbol, Qsignal) || EQ (symbol, Qexit)) | 831 | if (EQ (symbol, Qsignal) || EQ (symbol, Qexit)) |
| 832 | Fdelete (make_fixnum_or_float (pid), deleted_pid_list); | 832 | deleted_pid_list |
| 833 | = Fdelete (make_fixnum_or_float (pid), deleted_pid_list); | ||
| 833 | else | 834 | else |
| 834 | #endif | 835 | #endif |
| 835 | { | 836 | { |
| @@ -1817,7 +1818,8 @@ create_process (process, new_argv, current_dir) | |||
| 1817 | char **new_argv; | 1818 | char **new_argv; |
| 1818 | Lisp_Object current_dir; | 1819 | Lisp_Object current_dir; |
| 1819 | { | 1820 | { |
| 1820 | int pid, inchannel, outchannel; | 1821 | int inchannel, outchannel; |
| 1822 | pid_t pid; | ||
| 1821 | int sv[2]; | 1823 | int sv[2]; |
| 1822 | #ifdef POSIX_SIGNALS | 1824 | #ifdef POSIX_SIGNALS |
| 1823 | sigset_t procmask; | 1825 | sigset_t procmask; |
| @@ -3333,13 +3335,17 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3333 | #endif | 3335 | #endif |
| 3334 | } | 3336 | } |
| 3335 | 3337 | ||
| 3338 | immediate_quit = 0; | ||
| 3339 | |||
| 3336 | #ifdef HAVE_GETADDRINFO | 3340 | #ifdef HAVE_GETADDRINFO |
| 3337 | if (res != &ai) | 3341 | if (res != &ai) |
| 3338 | freeaddrinfo (res); | 3342 | { |
| 3343 | BLOCK_INPUT; | ||
| 3344 | freeaddrinfo (res); | ||
| 3345 | UNBLOCK_INPUT; | ||
| 3346 | } | ||
| 3339 | #endif | 3347 | #endif |
| 3340 | 3348 | ||
| 3341 | immediate_quit = 0; | ||
| 3342 | |||
| 3343 | /* Discard the unwind protect for closing S, if any. */ | 3349 | /* Discard the unwind protect for closing S, if any. */ |
| 3344 | specpdl_ptr = specpdl + count1; | 3350 | specpdl_ptr = specpdl + count1; |
| 3345 | 3351 | ||
| @@ -6392,7 +6398,7 @@ sigchld_handler (signo) | |||
| 6392 | 6398 | ||
| 6393 | while (1) | 6399 | while (1) |
| 6394 | { | 6400 | { |
| 6395 | register EMACS_INT pid; | 6401 | pid_t pid; |
| 6396 | WAITTYPE w; | 6402 | WAITTYPE w; |
| 6397 | Lisp_Object tail; | 6403 | Lisp_Object tail; |
| 6398 | 6404 | ||
| @@ -6401,16 +6407,17 @@ sigchld_handler (signo) | |||
| 6401 | #define WUNTRACED 0 | 6407 | #define WUNTRACED 0 |
| 6402 | #endif /* no WUNTRACED */ | 6408 | #endif /* no WUNTRACED */ |
| 6403 | /* Keep trying to get a status until we get a definitive result. */ | 6409 | /* Keep trying to get a status until we get a definitive result. */ |
| 6404 | while (1) { | 6410 | while (1) |
| 6405 | errno = 0; | 6411 | { |
| 6406 | pid = wait3 (&w, WNOHANG | WUNTRACED, 0); | 6412 | errno = 0; |
| 6407 | if (! (pid < 0 && errno == EINTR)) | 6413 | pid = wait3 (&w, WNOHANG | WUNTRACED, 0); |
| 6408 | break; | 6414 | if (! (pid < 0 && errno == EINTR)) |
| 6409 | /* avoid a busyloop: wait3 is a system call, so we do not want | 6415 | break; |
| 6410 | to prevent the kernel from actually sending SIGCHLD to emacs | 6416 | /* Avoid a busyloop: wait3 is a system call, so we do not want |
| 6411 | by asking for it all the time */ | 6417 | to prevent the kernel from actually sending SIGCHLD to emacs |
| 6412 | sleep (1); | 6418 | by asking for it all the time. */ |
| 6413 | } | 6419 | sleep (1); |
| 6420 | } | ||
| 6414 | 6421 | ||
| 6415 | if (pid <= 0) | 6422 | if (pid <= 0) |
| 6416 | { | 6423 | { |
| @@ -6436,11 +6443,15 @@ sigchld_handler (signo) | |||
| 6436 | /* Find the process that signaled us, and record its status. */ | 6443 | /* Find the process that signaled us, and record its status. */ |
| 6437 | 6444 | ||
| 6438 | /* The process can have been deleted by Fdelete_process. */ | 6445 | /* The process can have been deleted by Fdelete_process. */ |
| 6439 | tail = Fmember (make_fixnum_or_float (pid), deleted_pid_list); | 6446 | for (tail = deleted_pid_list; GC_CONSP (tail); tail = XCDR (tail)) |
| 6440 | if (!NILP (tail)) | ||
| 6441 | { | 6447 | { |
| 6442 | Fsetcar (tail, Qnil); | 6448 | Lisp_Object xpid = XCAR (tail); |
| 6443 | goto sigchld_end_of_loop; | 6449 | if ((GC_INTEGERP (xpid) && pid == (pid_t) XINT (xpid)) |
| 6450 | || (GC_FLOATP (xpid) && pid == (pid_t) XFLOAT_DATA (xpid))) | ||
| 6451 | { | ||
| 6452 | XSETCAR (tail, Qnil); | ||
| 6453 | goto sigchld_end_of_loop; | ||
| 6454 | } | ||
| 6444 | } | 6455 | } |
| 6445 | 6456 | ||
| 6446 | /* Otherwise, if it is asynchronous, it is in Vprocess_alist. */ | 6457 | /* Otherwise, if it is asynchronous, it is in Vprocess_alist. */ |