From ff8ba3cabe838db3f354b1d04f4b30abdf17df2c Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Fri, 7 Dec 2012 20:59:44 +0000 Subject: [PATCH] * exceptions.cc (sigpacket::process): Reorganize to avoid use of tls before initialization. * fhandler_fifo.cc (fhandler_fifo::arm): Avoid improper printing of integer as a string in debug output. --- winsup/cygwin/ChangeLog | 8 ++++++++ winsup/cygwin/exceptions.cc | 24 ++++++++++++------------ winsup/cygwin/fhandler_fifo.cc | 6 +++++- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 7e9d9ea1e..bbbad11a2 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,11 @@ +2012-12-07 Christopher Faylor + + * exceptions.cc (sigpacket::process): Reorganize to avoid use of tls + before initialization. + + * fhandler_fifo.cc (fhandler_fifo::arm): Avoid improper printing of + integer as a string in debug output. + 2012-12-07 Christopher Faylor * sigproc.h (sigpacket): Remove parameter names from declarations. diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index a28b90af5..590fcd9b5 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -1123,7 +1123,6 @@ sigpacket::process () { bool continue_now; struct sigaction dummy = global_sigs[SIGSTOP]; - _cygtls *tls; if (si.si_signo != SIGCONT) continue_now = false; @@ -1159,20 +1158,11 @@ sigpacket::process () myself->rusage_self.ru_nsignals++; - void *handler = (void *) thissig.sa_handler; - if (handler == SIG_IGN) - { - sigproc_printf ("signal %d ignored", si.si_signo); - goto done; - } - - if (have_execed) - handler = NULL; - + _cygtls *tls; if (sigtls) { tls = sigtls; - sigproc_printf ("using sigtls %p", tls); + sigproc_printf ("using sigtls %p", sigtls); } else { @@ -1180,6 +1170,16 @@ sigpacket::process () sigproc_printf ("using tls %p", tls); } + void *handler = (void *) thissig.sa_handler; + if (have_execed) + handler = NULL; + + if (handler == SIG_IGN) + { + sigproc_printf ("signal %d ignored", si.si_signo); + goto done; + } + if (si.si_signo == SIGKILL) goto exit_sig; if (si.si_signo == SIGSTOP) diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc index d2b236d5c..8a021bd62 100644 --- a/winsup/cygwin/fhandler_fifo.cc +++ b/winsup/cygwin/fhandler_fifo.cc @@ -68,7 +68,11 @@ fhandler_fifo::arm (HANDLE h) bool res = SetEvent (h); if (!res) - debug_printf ("SetEvent for %s failed, %E", res); +#ifdef DEBUGGING + debug_printf ("SetEvent for %s failed, %E", what); +#else + debug_printf ("SetEvent failed, %E"); +#endif return res; }