* signal.cc (_pinfo::kill): Avoid referencing 'pid' after ESRCH.

This commit is contained in:
Christopher Faylor 2011-05-03 02:03:04 +00:00
parent 705a187ee9
commit 3f359e3254
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2011-05-02 Christopher Faylor <me.cygwin2011@cgf.cx>
* signal.cc (_pinfo::kill): Avoid referencing 'pid' after ESRCH.
2011-05-02 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
* cygwin.din (pthread_attr_getstack): Export.

View File

@ -223,6 +223,7 @@ _pinfo::kill (siginfo_t& si)
{
int res;
DWORD this_process_state;
pid_t this_pid;
sig_dispatch_pending ();
@ -247,20 +248,23 @@ _pinfo::kill (siginfo_t& si)
si2.si_code = SI_KERNEL;
sig_send (this, si2);
}
this_pid = pid;
}
else if (si.si_signo == 0 && this)
{
this_process_state = process_state;
this_pid = pid;
res = 0;
}
else
{
set_errno (ESRCH);
this_process_state = 0;
this_pid = -1;
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, this_pid,
si.si_signo, this_process_state);
return res;
}