summaryrefslogtreecommitdiff
path: root/libc/stdlib/atexit.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/stdlib/atexit.c')
-rw-r--r--libc/stdlib/atexit.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libc/stdlib/atexit.c b/libc/stdlib/atexit.c
index bd6ac3db0..692e0c0fc 100644
--- a/libc/stdlib/atexit.c
+++ b/libc/stdlib/atexit.c
@@ -186,7 +186,10 @@ restart:
}
_ATEXIT_UNLOCK();
- fflush(NULL);
+ /* If called via exit(), flush output of all open files. */
+ if (dso == NULL) {
+ fflush(NULL);
+ }
/* BEGIN android-changed: call __unregister_atfork if dso is not null */
if (dso != NULL) {