Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2013-03-29 17:18:25 +0400
committerChristopher Faylor <me@cgf.cx>2013-03-29 17:18:25 +0400
commit6fcb2238583e71dc3a4fb88eec43de85c5c074eb (patch)
treeaa8140bf2ebaf0ce8e29a91c66ad1d98c796712f /winsup/cygwin/sigproc.cc
parent5e31c80e4e8d48fd6941ee3a5ba6f3b6c8c74cb7 (diff)
* sigproc.cc (wait_sig): Avoid uninitialized use of nb when retrying.
Consolidate two error messages into one.
Diffstat (limited to 'winsup/cygwin/sigproc.cc')
-rw-r--r--winsup/cygwin/sigproc.cc21
1 files changed, 5 insertions, 16 deletions
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index a38ff0251..015cbaf2b 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;