aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/sigproc.cc21
2 files changed, 11 insertions, 17 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 1ccbcf1..589b1a1 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -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.
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index a38ff02..015cbaf 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -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))
- {
- system_printf ("short read from signal pipe: %d != %d", nb,
- sizeof (pack));
- continue;
- }
-
- if (!pack.si.si_signo)
+ Sleep (INFINITE); /* Assume were exiting. Never exit this thread */
+ else if (nb != sizeof (pack) || !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;