* sigproc.cc (talktome): Take siginfo_t argument. Don't scan all pids trying

to find one that's talking to me.  Just use the pid from siginfo_t.
(wait_pid): Pass siginfo_t argument to talktome.
This commit is contained in:
Christopher Faylor 2005-09-19 14:15:06 +00:00
parent 64cf26a0e9
commit 1bde6e09a6
2 changed files with 12 additions and 7 deletions

View File

@ -1,3 +1,10 @@
2005-09-19 Christopher Faylor <cgf@timesys.com>
* sigproc.cc (talktome): Take siginfo_t argument. Don't scan all pids
trying to find one that's talking to me. Just use the pid from
siginfo_t.
(wait_pid): Pass siginfo_t argument to talktome.
2005-09-17 Christopher Faylor <cgf@timesys.com> 2005-09-17 Christopher Faylor <cgf@timesys.com>
* pipe.cc (fhandler_pipe::open): Use 'cfree' to free buffer since it is * pipe.cc (fhandler_pipe::open): Use 'cfree' to free buffer since it is

View File

@ -922,13 +922,11 @@ stopped_or_terminated (waitq *parent_w, _pinfo *child)
} }
static void static void
talktome () talktome (siginfo_t& si)
{ {
winpids pids ((DWORD) PID_MAP_RW); pinfo p (si.si_pid, PID_MAP_RW);
for (unsigned i = 0; i < pids.npids; i++) if (p)
if (pids[i]->hello_pid == myself->pid) p->commune_recv ();
if (!IsBadWritePtr (pids[i], sizeof (_pinfo)))
pids[i]->commune_recv ();
} }
void void
@ -1041,7 +1039,7 @@ wait_sig (VOID *self)
switch (pack.si.si_signo) switch (pack.si.si_signo)
{ {
case __SIGCOMMUNE: case __SIGCOMMUNE:
talktome (); talktome (pack.si);
break; break;
case __SIGSTRACE: case __SIGSTRACE:
strace.hello (); strace.hello ();