diff options
author | dhartmei <> | 2002-07-31 18:13:16 +0000 |
---|---|---|
committer | dhartmei <> | 2002-07-31 18:13:16 +0000 |
commit | f5498364761a8d35366c6a7c7b4b9435539a308f (patch) | |
tree | f4ae10888f77b3ce0126da2b1995239a28cef58f /src/lib/libc/stdlib/exit.c | |
parent | a61a213f9ae18d6b4d22d37d67709147cf7506f6 (diff) | |
download | openbsd-f5498364761a8d35366c6a7c7b4b9435539a308f.tar.gz openbsd-f5498364761a8d35366c6a7c7b4b9435539a308f.tar.bz2 openbsd-f5498364761a8d35366c6a7c7b4b9435539a308f.zip |
Back it out, it breaks something in perl (seen with spamassassin), debug
first.
Diffstat (limited to 'src/lib/libc/stdlib/exit.c')
-rw-r--r-- | src/lib/libc/stdlib/exit.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/lib/libc/stdlib/exit.c b/src/lib/libc/stdlib/exit.c index c16b33bd30..0bf0d3a180 100644 --- a/src/lib/libc/stdlib/exit.c +++ b/src/lib/libc/stdlib/exit.c | |||
@@ -32,11 +32,9 @@ | |||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #if defined(LIBC_SCCS) && !defined(lint) | 34 | #if defined(LIBC_SCCS) && !defined(lint) |
35 | static char *rcsid = "$OpenBSD: exit.c,v 1.5 2002/07/29 19:54:42 dhartmei Exp $"; | 35 | static char *rcsid = "$OpenBSD: exit.c,v 1.6 2002/07/31 18:13:16 dhartmei Exp $"; |
36 | #endif /* LIBC_SCCS and not lint */ | 36 | #endif /* LIBC_SCCS and not lint */ |
37 | 37 | ||
38 | #include <sys/types.h> | ||
39 | #include <sys/mman.h> | ||
40 | #include <stdlib.h> | 38 | #include <stdlib.h> |
41 | #include <unistd.h> | 39 | #include <unistd.h> |
42 | #include "atexit.h" | 40 | #include "atexit.h" |
@@ -60,19 +58,12 @@ void | |||
60 | exit(status) | 58 | exit(status) |
61 | int status; | 59 | int status; |
62 | { | 60 | { |
63 | register struct atexit *p, *q; | 61 | register struct atexit *p; |
64 | register int n, pgsize = getpagesize(); | 62 | register int n; |
65 | 63 | ||
66 | if (!__atexit_invalid) { | 64 | for (p = __atexit; p; p = p->next) |
67 | p = __atexit; | 65 | for (n = p->ind; --n >= 0;) |
68 | while (p != NULL) { | 66 | (*p->fns[n])(); |
69 | for (n = p->ind; --n >= 0;) | ||
70 | (*p->fns[n])(); | ||
71 | q = p; | ||
72 | p = p->next; | ||
73 | munmap(q, pgsize); | ||
74 | } | ||
75 | } | ||
76 | if (__cleanup) | 67 | if (__cleanup) |
77 | (*__cleanup)(); | 68 | (*__cleanup)(); |
78 | _exit(status); | 69 | _exit(status); |