diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-01-20 14:03:55 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-01-20 14:03:55 -0800 |
commit | d37527501c85edcb3a6a7c8a0b6297d52d434897 (patch) | |
tree | f005d945ce90569b8e63cf42294ab42dddab52c2 /libc/stdlib/exit.c | |
parent | e5cc1f386b167b9f7bfdebc7219e89aa9b71e4b2 (diff) | |
download | bionic-d37527501c85edcb3a6a7c8a0b6297d52d434897.zip bionic-d37527501c85edcb3a6a7c8a0b6297d52d434897.tar.gz bionic-d37527501c85edcb3a6a7c8a0b6297d52d434897.tar.bz2 |
auto import from //branches/cupcake/...@127101
Diffstat (limited to 'libc/stdlib/exit.c')
-rw-r--r-- | libc/stdlib/exit.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/libc/stdlib/exit.c b/libc/stdlib/exit.c index 8fafcf5..83fe3d2 100644 --- a/libc/stdlib/exit.c +++ b/libc/stdlib/exit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exit.c,v 1.11 2005/08/08 08:05:36 espie Exp $ */ +/* $OpenBSD: exit.c,v 1.12 2007/09/03 14:40:16 millert Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -50,20 +50,10 @@ int __isthreaded = 0; void exit(int status) { - struct atexit *p, *q; - int n, pgsize = getpagesize(); - - if (!__atexit_invalid) { - p = __atexit; - while (p != NULL) { - for (n = p->ind; --n >= 0;) - if (p->fns[n] != NULL) - (*p->fns[n])(); - q = p; - p = p->next; - munmap(q, pgsize); - } - } - /* cleanup, if registered, was called through fns[0] in the last page */ + /* + * Call functions registered by atexit() or _cxa_atexit() + * (including the stdio cleanup routine) and then _exit(). + */ + __cxa_finalize(NULL); _exit(status); } |