Don't kill already-reaped process.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 27 May 2014 03:46:30 +0000 (20:46 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 27 May 2014 03:46:30 +0000 (20:46 -0700)
commitca0279be7037b3f8bf659ef8b073ea847d0d8553
treede126355f2188009eee679a4b36b38404838e941
parent9aecbeb30847520f92ba273ec149c9ea5f289c51
Don't kill already-reaped process.

* process.c (process_send_signal): Fix race condition where a
subprocess was reaped by a signal handler between the check for
liveness and calling 'kill', which meant that Emacs could in
theory kill an innocent bystander process.  Do the fix by blocking
SIGCHLD in a critical section that checks liveness before killing.

Fixes: debbugs:17561
src/ChangeLog
src/process.c