Skip to content

Commit a66f0a6

Browse files
no1wudixiaoxiang781216
authored andcommitted
stdlib: Guard fflush in exit with CONFIG_FILE_STREAM
If CONFIG_FILE_STREAM disabled, fflush is a undefined function. Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
1 parent 1b372a5 commit a66f0a6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libs/libc/stdlib/lib_exit.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,11 @@ void exit(int status)
8888

8989
atexit_call_exitfuncs(status, false);
9090

91+
#ifdef CONFIG_FILE_STREAM
9192
/* Flush all streams */
9293

9394
fflush(NULL);
95+
#endif
9496

9597
/* Then perform the exit */
9698

0 commit comments

Comments
 (0)