* sigproc.cc (wait_sig): Avoid uninitialized use of nb when retrying.

Consolidate two error messages into one.
This commit is contained in:
Christopher Faylor
2013-03-29 13:18:25 +00:00
parent 5e31c80e4e
commit 6fcb223858
2 changed files with 11 additions and 17 deletions

View File

@ -1288,27 +1288,16 @@ wait_sig (VOID *)
DWORD nb;
sigpacket pack = {};
if (sigq.retry)
{
sigq.retry = false;
pack.si.si_signo = __SIGFLUSH;
}
pack.si.si_signo = __SIGFLUSH;
else if (!ReadFile (my_readsig, &pack, sizeof (pack), &nb, NULL))
Sleep (INFINITE); /* Never exit this thread */
if (nb != sizeof (pack))
Sleep (INFINITE); /* Assume were exiting. Never exit this thread */
else if (nb != sizeof (pack) || !pack.si.si_signo)
{
system_printf ("short read from signal pipe: %d != %d", nb,
sizeof (pack));
continue;
}
if (!pack.si.si_signo)
{
#ifdef DEBUGGING
system_printf ("zero signal?");
#endif
system_printf ("garbled signal pipe data nb %u, sig %d", nb, pack.si.si_signo);
continue;
}
sigq.retry = false;
/* Don't process signals when we start exiting */
if (exit_state > ES_EXIT_STARTING && pack.si.si_signo > 0)
continue;