From 03e039820dc5092e27e81f3671652f25da7f25f1 Mon Sep 17 00:00:00 2001 From: Manuel Novoa III Date: Tue, 12 Mar 2002 01:18:50 +0000 Subject: Swap in the new stdio code. --- libc/stdlib/atexit.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'libc/stdlib/atexit.c') diff --git a/libc/stdlib/atexit.c b/libc/stdlib/atexit.c index d22d6a5e7..95047e78f 100644 --- a/libc/stdlib/atexit.c +++ b/libc/stdlib/atexit.c @@ -17,7 +17,7 @@ * Changed name of __cleanup to __uClibc_cleanup. * Moved declaration of __uClibc_cleanup to __uClibc_main * where it is initialized with (possibly weak alias) - * __stdio_flush_buffers. + * _stdio_term. * * Jul 2001 Steve Thayer * @@ -141,7 +141,7 @@ void __exit_handler(int status) #endif #ifdef L_exit -extern void weak_function __stdio_flush_buffers(void); +extern void weak_function _stdio_term(void); void (*__exit_cleanup) (int) = 0; /* @@ -154,9 +154,12 @@ void exit(int rv) __exit_cleanup(rv); } - /* Clean up everything else */ - if (__stdio_flush_buffers) - __stdio_flush_buffers(); + /* If we are using stdio, try to shut it down. At the very least, + * this will attempt to commit all buffered writes. It may also + * unbuffer all writable files, or close them outright. + * Check the stdio routines for details. */ + if (_stdio_term) + _stdio_term(); _exit(rv); } -- cgit v1.2.3