diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2007-03-17 18:16:03 +0000 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2007-03-17 18:16:03 +0000 |
commit | 8e050977ee78cb7cf2152fc56baf1cbd7a4afd6e (patch) | |
tree | d202eb5d273df0a210d3af6b251fd9996966eacc /src/process.c | |
parent | 46adc7a566a687513450388cb201895b4d351d1d (diff) | |
download | emacs-8e050977ee78cb7cf2152fc56baf1cbd7a4afd6e.tar.gz emacs-8e050977ee78cb7cf2152fc56baf1cbd7a4afd6e.tar.bz2 emacs-8e050977ee78cb7cf2152fc56baf1cbd7a4afd6e.zip |
(sigchld_handler): Change type of pid to pid_t. Scan deleted_pid_list
explicitly to avoid using Fmember which don't know about mark bits and
make_fixnum_or_float which may malloc. Reported by Andreas Schwab.
Diffstat (limited to 'src/process.c')
-rw-r--r-- | src/process.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/process.c b/src/process.c index 975d92f36f1..f6990c2ff19 100644 --- a/src/process.c +++ b/src/process.c @@ -6486,7 +6486,7 @@ sigchld_handler (signo) while (1) { - register EMACS_INT pid; + pid_t pid; WAITTYPE w; Lisp_Object tail; @@ -6530,11 +6530,15 @@ sigchld_handler (signo) /* Find the process that signaled us, and record its status. */ /* The process can have been deleted by Fdelete_process. */ - tail = Fmember (make_fixnum_or_float (pid), deleted_pid_list); - if (!NILP (tail)) + for (tail = deleted_pid_list; GC_CONSP (tail); tail = XCDR (tail)) { - Fsetcar (tail, Qnil); - goto sigchld_end_of_loop; + Lisp_Object xpid = XCAR (tail); + if ((GC_INTEGERP (xpid) && pid == (pid_t) XINT (xpid)) + || (GC_FLOATP (xpid) && pid == (pid_t) XFLOAT_DATA (xpid))) + { + XSETCAR (tail, Qnil); + goto sigchld_end_of_loop; + } } /* Otherwise, if it is asynchronous, it is in Vprocess_alist. */ |