diff options
author | Christopher Faylor <me@cgf.cx> | 2011-05-05 04:31:22 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2011-05-05 04:31:22 +0400 |
commit | 5069a2b0d9533b36f55928728d1b1bffedc43545 (patch) | |
tree | 90744224ab7473d8a2999e8118cc81078b364278 /winsup/cygwin/signal.cc | |
parent | 942945956c3f9d027aeee47ce66ee5cc221a9e6f (diff) |
* signal.cc (_pinfo::kill): Return success on kill(0) only if pid exists or is
in PID_EXITED state. Report pid 0 when pid does not exist rather than pid -1.
Make debug output reflect actual function call.
* sigproc.cc (stopped_or_terminated): Set process state to reaped when we've
finished waiting for it.
* include/sys/cygwin.h (PID_REAPED): New enum.
Diffstat (limited to 'winsup/cygwin/signal.cc')
-rw-r--r-- | winsup/cygwin/signal.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc index 78b0f1d5b..8d9f592a4 100644 --- a/winsup/cygwin/signal.cc +++ b/winsup/cygwin/signal.cc @@ -250,7 +250,7 @@ _pinfo::kill (siginfo_t& si) } this_pid = pid; } - else if (si.si_signo == 0 && this) + else if (si.si_signo == 0 && this && process_state == PID_EXITED) { this_process_state = process_state; this_pid = pid; @@ -260,12 +260,12 @@ _pinfo::kill (siginfo_t& si) { set_errno (ESRCH); this_process_state = 0; - this_pid = -1; + this_pid = 0; res = -1; } - syscall_printf ("%d = _pinfo::kill (%d, %d), process_state %p", res, this_pid, - si.si_signo, this_process_state); + syscall_printf ("%d = _pinfo::kill (%d), pid %d, process_state %p", res, + si.si_signo, this_pid, this_process_state); return res; } |