diff options
author | millert <> | 2004-01-20 19:35:17 +0000 |
---|---|---|
committer | millert <> | 2004-01-20 19:35:17 +0000 |
commit | 8ad0502d4b92b34ae8cdc05181efcea7cff76c14 (patch) | |
tree | 6ec6b4fa61542d78ee2c2bbdd4bb1b3d973cc952 | |
parent | e794a18f3a5f5701d8afd76570112e83b4f8a336 (diff) | |
download | openbsd-8ad0502d4b92b34ae8cdc05181efcea7cff76c14.tar.gz openbsd-8ad0502d4b92b34ae8cdc05181efcea7cff76c14.tar.bz2 openbsd-8ad0502d4b92b34ae8cdc05181efcea7cff76c14.zip |
Call _exit() not exit() from abort() if we are unable to kill ourselves
to avoid flushing stdio twice. This code path should never really
happen though. Also make the function declaration ANSI. OK deraadt@
-rw-r--r-- | src/lib/libc/stdlib/abort.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libc/stdlib/abort.c b/src/lib/libc/stdlib/abort.c index 3f32dc5dc1..2430c124f9 100644 --- a/src/lib/libc/stdlib/abort.c +++ b/src/lib/libc/stdlib/abort.c | |||
@@ -28,7 +28,7 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #if defined(LIBC_SCCS) && !defined(lint) | 30 | #if defined(LIBC_SCCS) && !defined(lint) |
31 | static char *rcsid = "$OpenBSD: abort.c,v 1.12 2003/06/02 20:18:37 millert Exp $"; | 31 | static char *rcsid = "$OpenBSD: abort.c,v 1.13 2004/01/20 19:35:17 millert Exp $"; |
32 | #endif /* LIBC_SCCS and not lint */ | 32 | #endif /* LIBC_SCCS and not lint */ |
33 | 33 | ||
34 | #include <signal.h> | 34 | #include <signal.h> |
@@ -38,7 +38,7 @@ static char *rcsid = "$OpenBSD: abort.c,v 1.12 2003/06/02 20:18:37 millert Exp $ | |||
38 | #include "atexit.h" | 38 | #include "atexit.h" |
39 | 39 | ||
40 | void | 40 | void |
41 | abort() | 41 | abort(void) |
42 | { | 42 | { |
43 | struct atexit *p = __atexit; | 43 | struct atexit *p = __atexit; |
44 | static int cleanup_called = 0; | 44 | static int cleanup_called = 0; |
@@ -74,5 +74,5 @@ abort() | |||
74 | (void)signal(SIGABRT, SIG_DFL); | 74 | (void)signal(SIGABRT, SIG_DFL); |
75 | (void)_thread_sys_sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL); | 75 | (void)_thread_sys_sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL); |
76 | (void)kill(getpid(), SIGABRT); | 76 | (void)kill(getpid(), SIGABRT); |
77 | exit(1); | 77 | _exit(1); |
78 | } | 78 | } |