aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2017-10-05 14:48:16 +0200
committerFlorian Weimer <fweimer@redhat.com>2017-10-05 14:48:16 +0200
commit91e7cf982d0104f0e71770f5ae8e3faf352dea9f (patch)
treebe60472784d16ffa545c70e5ccb0108bf85c174e /stdlib
parent0c25125780083cbba22ed627756548efe282d1a0 (diff)
downloadglibc-91e7cf982d0104f0e71770f5ae8e3faf352dea9f.zip
glibc-91e7cf982d0104f0e71770f5ae8e3faf352dea9f.tar.gz
glibc-91e7cf982d0104f0e71770f5ae8e3faf352dea9f.tar.bz2
abort: Do not flush stdio streams [BZ #15436]
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/abort.c29
1 files changed, 5 insertions, 24 deletions
diff --git a/stdlib/abort.c b/stdlib/abort.c
index 19882f3..117a507 100644
--- a/stdlib/abort.c
+++ b/stdlib/abort.c
@@ -31,9 +31,6 @@
# define ABORT_INSTRUCTION
#endif
-#include <libio/libioP.h>
-#define fflush(s) _IO_flush_all_lockp (0)
-
/* Exported variable to locate abort message in core files etc. */
struct abort_msg_s *__abort_msg __attribute__ ((nocommon));
libc_hidden_def (__abort_msg)
@@ -67,16 +64,8 @@ abort (void)
__sigprocmask (SIG_UNBLOCK, &sigs, 0);
}
- /* Flush all streams. We cannot close them now because the user
- might have registered a handler for SIGABRT. */
- if (stage == 1)
- {
- ++stage;
- fflush (NULL);
- }
-
/* Send signal which possibly calls a user handler. */
- if (stage == 2)
+ if (stage == 1)
{
/* This stage is special: we must allow repeated calls of
`abort' when a user defined handler for SIGABRT is installed.
@@ -94,7 +83,7 @@ abort (void)
}
/* There was a handler installed. Now remove it. */
- if (stage == 3)
+ if (stage == 2)
{
++stage;
memset (&act, '\0', sizeof (struct sigaction));
@@ -104,30 +93,22 @@ abort (void)
__sigaction (SIGABRT, &act, NULL);
}
- /* Now close the streams which also flushes the output the user
- defined handler might has produced. */
- if (stage == 4)
- {
- ++stage;
- __fcloseall ();
- }
-
/* Try again. */
- if (stage == 5)
+ if (stage == 3)
{
++stage;
raise (SIGABRT);
}
/* Now try to abort using the system specific command. */
- if (stage == 6)
+ if (stage == 4)
{
++stage;
ABORT_INSTRUCTION;
}
/* If we can't signal ourselves and the abort instruction failed, exit. */
- if (stage == 7)
+ if (stage == 5)
{
++stage;
_exit (127);