Register _cleanup function with atexit
* Register cleanup function with atexit instead of calling it explicitly on exit() * abort() no longer calls _cleanup: Flushing stdio buffers on abort is no longer required by POSIX. * dlmalloc no longer need to reset cleanup (see above) * Upstream findfp.c makebuf.c setvbuf.cexit.c to openbsd versions. Bug: 14415367 Change-Id: I277058852485a9d3dbb13e5c232db5f9948d78ac
This commit is contained in:
@@ -32,8 +32,6 @@
|
||||
#include <unistd.h>
|
||||
#include "atexit.h"
|
||||
|
||||
__LIBC_HIDDEN__ void (*__cleanup)();
|
||||
|
||||
#ifdef __arm__
|
||||
extern "C" __LIBC_HIDDEN__ void __libc_android_abort()
|
||||
#else
|
||||
@@ -47,11 +45,6 @@ void abort()
|
||||
sigdelset(&mask, SIGABRT);
|
||||
sigprocmask(SIG_SETMASK, &mask, NULL);
|
||||
|
||||
// POSIX requires we flush stdio buffers on abort.
|
||||
if (__cleanup) {
|
||||
(*__cleanup)();
|
||||
}
|
||||
|
||||
raise(SIGABRT);
|
||||
|
||||
// If SIGABRT ignored, or caught and the handler returns,
|
||||
|
Reference in New Issue
Block a user