summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/exit.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdlib/exit.c')
-rw-r--r--lib/libc/stdlib/exit.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/lib/libc/stdlib/exit.c b/lib/libc/stdlib/exit.c
index c16b33bd300..0bf0d3a1808 100644
--- a/lib/libc/stdlib/exit.c
+++ b/lib/libc/stdlib/exit.c
@@ -32,11 +32,9 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: exit.c,v 1.5 2002/07/29 19:54:42 dhartmei Exp $";
+static char *rcsid = "$OpenBSD: exit.c,v 1.6 2002/07/31 18:13:16 dhartmei Exp $";
#endif /* LIBC_SCCS and not lint */
-#include <sys/types.h>
-#include <sys/mman.h>
#include <stdlib.h>
#include <unistd.h>
#include "atexit.h"
@@ -60,19 +58,12 @@ void
exit(status)
int status;
{
- register struct atexit *p, *q;
- register int n, pgsize = getpagesize();
+ register struct atexit *p;
+ register int n;
- if (!__atexit_invalid) {
- p = __atexit;
- while (p != NULL) {
- for (n = p->ind; --n >= 0;)
- (*p->fns[n])();
- q = p;
- p = p->next;
- munmap(q, pgsize);
- }
- }
+ for (p = __atexit; p; p = p->next)
+ for (n = p->ind; --n >= 0;)
+ (*p->fns[n])();
if (__cleanup)
(*__cleanup)();
_exit(status);