From a66f0a63698049a55e29a67ee71f895fc40db758 Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Sat, 11 Feb 2023 08:51:42 +0800 Subject: [PATCH] stdlib: Guard fflush in exit with CONFIG_FILE_STREAM If CONFIG_FILE_STREAM disabled, fflush is a undefined function. Signed-off-by: Huang Qi --- libs/libc/stdlib/lib_exit.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/libc/stdlib/lib_exit.c b/libs/libc/stdlib/lib_exit.c index 2cef9eff1b3..7d82ffdc21a 100644 --- a/libs/libc/stdlib/lib_exit.c +++ b/libs/libc/stdlib/lib_exit.c @@ -88,9 +88,11 @@ void exit(int status) atexit_call_exitfuncs(status, false); +#ifdef CONFIG_FILE_STREAM /* Flush all streams */ fflush(NULL); +#endif /* Then perform the exit */