From c3be772441cfebbf0e87226087081dd2a6c0d0de Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 22 Oct 2023 04:51:59 +0800 Subject: [PATCH] libc/stdio: lib_fwrite_unlocked must call lib_fflush_unlocked with true otherwise the following file i/o mess up the output Signed-off-by: Xiang Xiao --- libs/libc/stdio/lib_libfwrite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/libc/stdio/lib_libfwrite.c b/libs/libc/stdio/lib_libfwrite.c index 8150b1cff6..f5730c4dbe 100644 --- a/libs/libc/stdio/lib_libfwrite.c +++ b/libs/libc/stdio/lib_libfwrite.c @@ -130,7 +130,7 @@ ssize_t lib_fwrite_unlocked(FAR const void *ptr, size_t count, { /* Flush the buffered data to the IO stream */ - int bytes_buffered = lib_fflush_unlocked(stream, false); + int bytes_buffered = lib_fflush_unlocked(stream, true); if (bytes_buffered < 0) { goto errout;