Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2011-04-18 01:45:28 +0400
committerChristopher Faylor <me@cgf.cx>2011-04-18 01:45:28 +0400
commitfdcae03c0fc805f74b0060ae398ff561742a982b (patch)
treedf1af0140090091f34e32e645f3d265842f80b61 /winsup/cygwin/signal.cc
parentf4c1f003e3aaf8313fa86f511f72470dae984910 (diff)
* signal.cc (_pinfo::kill): Return 0 when attempting to test for existence of
an existed process which has not yet been reaped.
Diffstat (limited to 'winsup/cygwin/signal.cc')
-rw-r--r--winsup/cygwin/signal.cc50
1 files changed, 29 insertions, 21 deletions
diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc
index 615104e80..41eb03ec5 100644
--- a/winsup/cygwin/signal.cc
+++ b/winsup/cygwin/signal.cc
@@ -221,34 +221,42 @@ handle_sigprocmask (int how, const sigset_t *set, sigset_t *oldset, sigset_t& op
int __stdcall
_pinfo::kill (siginfo_t& si)
{
- sig_dispatch_pending ();
+ int res;
+ DWORD this_process_state;
- int res = 0;
- bool sendSIGCONT;
+ sig_dispatch_pending ();
- if (!exists ())
+ if (exists ())
{
- set_errno (ESRCH);
- return -1;
- }
+ bool sendSIGCONT;
+ if ((sendSIGCONT = (si.si_signo < 0)))
+ si.si_signo = -si.si_signo;
- if ((sendSIGCONT = (si.si_signo < 0)))
- si.si_signo = -si.si_signo;
-
- DWORD this_process_state = process_state;
- if (si.si_signo == 0)
- /* ok */;
- else if ((res = sig_send (this, si)))
+ if (si.si_signo == 0)
+ res = 0;
+ else if ((res = sig_send (this, si)))
+ {
+ sigproc_printf ("%d = sig_send, %E ", res);
+ res = -1;
+ }
+ else if (sendSIGCONT)
+ {
+ siginfo_t si2 = {0};
+ si2.si_signo = SIGCONT;
+ si2.si_code = SI_KERNEL;
+ sig_send (this, si2);
+ }
+ }
+ else if (si.si_signo == 0 && this)
{
- sigproc_printf ("%d = sig_send, %E ", res);
- res = -1;
+ this_process_state = process_state;
+ res = 0;
}
- else if (sendSIGCONT)
+ else
{
- siginfo_t si2 = {0};
- si2.si_signo = SIGCONT;
- si2.si_code = SI_KERNEL;
- sig_send (this, si2);
+ set_errno (ESRCH);
+ this_process_state = 0;
+ res = -1;
}
syscall_printf ("%d = _pinfo::kill (%d, %d), process_state %p", res, pid,