* signal.cc (_pinfo::kill): Return 0 when attempting to test for existence of
an existed process which has not yet been reaped.
This commit is contained in:
parent
f4c1f003e3
commit
fdcae03c0f
@ -1,3 +1,8 @@
|
|||||||
|
2011-04-17 Christopher Faylor <me.cygwin2011@cgf.cx>
|
||||||
|
|
||||||
|
* signal.cc (_pinfo::kill): Return 0 when attempting to test for
|
||||||
|
existence of an existed process which has not yet been reaped.
|
||||||
|
|
||||||
2011-04-17 Christopher Faylor <me.cygwin2011@cgf.cx>
|
2011-04-17 Christopher Faylor <me.cygwin2011@cgf.cx>
|
||||||
|
|
||||||
* cygheap.h (init_cygheap::ctty): Use base class so that console can
|
* cygheap.h (init_cygheap::ctty): Use base class so that console can
|
||||||
|
@ -221,23 +221,19 @@ handle_sigprocmask (int how, const sigset_t *set, sigset_t *oldset, sigset_t& op
|
|||||||
int __stdcall
|
int __stdcall
|
||||||
_pinfo::kill (siginfo_t& si)
|
_pinfo::kill (siginfo_t& si)
|
||||||
{
|
{
|
||||||
|
int res;
|
||||||
|
DWORD this_process_state;
|
||||||
|
|
||||||
sig_dispatch_pending ();
|
sig_dispatch_pending ();
|
||||||
|
|
||||||
int res = 0;
|
if (exists ())
|
||||||
bool sendSIGCONT;
|
|
||||||
|
|
||||||
if (!exists ())
|
|
||||||
{
|
{
|
||||||
set_errno (ESRCH);
|
bool sendSIGCONT;
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((sendSIGCONT = (si.si_signo < 0)))
|
if ((sendSIGCONT = (si.si_signo < 0)))
|
||||||
si.si_signo = -si.si_signo;
|
si.si_signo = -si.si_signo;
|
||||||
|
|
||||||
DWORD this_process_state = process_state;
|
|
||||||
if (si.si_signo == 0)
|
if (si.si_signo == 0)
|
||||||
/* ok */;
|
res = 0;
|
||||||
else if ((res = sig_send (this, si)))
|
else if ((res = sig_send (this, si)))
|
||||||
{
|
{
|
||||||
sigproc_printf ("%d = sig_send, %E ", res);
|
sigproc_printf ("%d = sig_send, %E ", res);
|
||||||
@ -250,6 +246,18 @@ _pinfo::kill (siginfo_t& si)
|
|||||||
si2.si_code = SI_KERNEL;
|
si2.si_code = SI_KERNEL;
|
||||||
sig_send (this, si2);
|
sig_send (this, si2);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else if (si.si_signo == 0 && this)
|
||||||
|
{
|
||||||
|
this_process_state = process_state;
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
set_errno (ESRCH);
|
||||||
|
this_process_state = 0;
|
||||||
|
res = -1;
|
||||||
|
}
|
||||||
|
|
||||||
syscall_printf ("%d = _pinfo::kill (%d, %d), process_state %p", res, pid,
|
syscall_printf ("%d = _pinfo::kill (%d, %d), process_state %p", res, pid,
|
||||||
si.si_signo, this_process_state);
|
si.si_signo, this_process_state);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user