* 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

@ -1,9 +1,14 @@
2013-03-29 Christopher Faylor <me.cygwin2013@cgf.cx>
* sigproc.cc (wait_sig): Avoid uninitialized use of nb when retrying.
Consolidate two error messages into one.
2013-03-28 Christopher Faylor <me.cygwin2013@cgf.cx>
* sigproc.cc (pending_signals::retry): Declare new element.
(pending_signals::pending): Force an additional loop through wait_sig
by setting retry whenever this function is called.
(sig_send): Reorganize to wait for SIGHOLD at bottom. Always add
(wait_sig): Reorganize to wait for SIGHOLD at bottom. Always add
signal to pending queue and work on whole queue rather than just the
one signal. Loop when sigq.retry is set. Fix long-broken check for
SIGCHLD after queued signals.

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;