aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2008-06-09 13:45:59 +0000
committerChristopher Faylor <me@cgf.cx>2008-06-09 13:45:59 +0000
commitc230ba2a1c2fb87a77c541245671b4648f04e839 (patch)
tree3ec5fd391eb719ea727aea654898a72d008154cf /winsup/cygwin
parent7d6b567a4f5baa29d3e59a86b505b0bcaa574d73 (diff)
downloadnewlib-c230ba2a1c2fb87a77c541245671b4648f04e839.zip
newlib-c230ba2a1c2fb87a77c541245671b4648f04e839.tar.gz
newlib-c230ba2a1c2fb87a77c541245671b4648f04e839.tar.bz2
* signal.cc (abort): Only flush streams after signal handler.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/signal.cc14
2 files changed, 8 insertions, 10 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 911792b..949f0a9 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,7 @@
+008-06-09 Eric Blake <ebb9@byu.net>
+
+ * signal.cc (abort): Only flush streams after signal handler.
+
2008-06-02 Christopher Faylor <me+cygwin@cgf.cx>
* cygwin.sc: Remove unrequired and erroneous definition.
diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc
index c39afc2..b3654de 100644
--- a/winsup/cygwin/signal.cc
+++ b/winsup/cygwin/signal.cc
@@ -324,16 +324,6 @@ abort (void)
{
_my_tls.incyg++;
sig_dispatch_pending ();
- /* Flush all streams as per SUSv2.
- From my reading of this document, this isn't strictly correct.
- The streams are supposed to be flushed prior to exit. However,
- if there is I/O in any signal handler that will not necessarily
- be flushed.
- However this is the way FreeBSD does it, and it is much easier to
- do things this way, so... */
- if (_GLOBAL_REENT->__cleanup)
- _GLOBAL_REENT->__cleanup (_GLOBAL_REENT);
-
/* Ensure that SIGABRT can be caught regardless of blockage. */
sigset_t sig_mask;
sigfillset (&sig_mask);
@@ -342,6 +332,10 @@ abort (void)
raise (SIGABRT);
_my_tls.call_signal_handler (); /* Call any signal handler */
+
+ /* Flush all streams as per SUSv2. */
+ if (_GLOBAL_REENT->__cleanup)
+ _GLOBAL_REENT->__cleanup (_GLOBAL_REENT);
do_exit (SIGABRT); /* signal handler didn't exit. Goodbye. */
}