diff --git a/libs/libc/libc.h b/libs/libc/libc.h index 178fa44737a..ba339d48d56 100644 --- a/libs/libc/libc.h +++ b/libs/libc/libc.h @@ -211,8 +211,8 @@ FAR char *lib_fgets_unlocked(FAR char *buf, size_t buflen, FILE *stream, /* Defined in lib_libfflush.c */ -ssize_t lib_fflush(FAR FILE *stream, bool bforce); -ssize_t lib_fflush_unlocked(FAR FILE *stream, bool bforce); +ssize_t lib_fflush(FAR FILE *stream); +ssize_t lib_fflush_unlocked(FAR FILE *stream); /* Defined in lib_rdflush_unlocked.c */ diff --git a/libs/libc/stdio/lib_fclose.c b/libs/libc/stdio/lib_fclose.c index 357f7f9f93f..174238c45f6 100644 --- a/libs/libc/stdio/lib_fclose.c +++ b/libs/libc/stdio/lib_fclose.c @@ -75,7 +75,7 @@ int fclose(FAR FILE *stream) if ((stream->fs_oflags & O_WROK) != 0) { - ret = lib_fflush(stream, true); + ret = lib_fflush(stream); errcode = get_errno(); } diff --git a/libs/libc/stdio/lib_fflush.c b/libs/libc/stdio/lib_fflush.c index 532b327264f..cbe4e7a6026 100644 --- a/libs/libc/stdio/lib_fflush.c +++ b/libs/libc/stdio/lib_fflush.c @@ -66,7 +66,7 @@ int fflush(FAR FILE *stream) } else { - ret = lib_fflush(stream, true); + ret = lib_fflush(stream); } /* Check the return value */ diff --git a/libs/libc/stdio/lib_fputc.c b/libs/libc/stdio/lib_fputc.c index 132468e0510..ac7c06f8ee2 100644 --- a/libs/libc/stdio/lib_fputc.c +++ b/libs/libc/stdio/lib_fputc.c @@ -45,7 +45,7 @@ int fputc_unlocked(int c, FAR FILE *stream) if (c == '\n' && (stream->fs_flags & __FS_FLAG_LBF) != 0) { - ret = lib_fflush_unlocked(stream, true); + ret = lib_fflush_unlocked(stream); if (ret < 0) { return EOF; diff --git a/libs/libc/stdio/lib_fputs.c b/libs/libc/stdio/lib_fputs.c index 60b67931537..4ae8b50538c 100644 --- a/libs/libc/stdio/lib_fputs.c +++ b/libs/libc/stdio/lib_fputs.c @@ -67,7 +67,7 @@ int fputs_unlocked(FAR const IPTR char *s, FAR FILE *stream) if (ch == '\n' && (stream->fs_flags & __FS_FLAG_LBF) != 0) { - ret = lib_fflush_unlocked(stream, true); + ret = lib_fflush_unlocked(stream); if (ret < 0) { return EOF; @@ -107,7 +107,7 @@ int fputs_unlocked(FAR const IPTR char *s, FAR FILE *stream) if (*s == '\n') { - ret = lib_fflush_unlocked(stream, true); + ret = lib_fflush_unlocked(stream); if (ret < 0) { return EOF; diff --git a/libs/libc/stdio/lib_freopen.c b/libs/libc/stdio/lib_freopen.c index 7ca87f4c8a9..b9b52dbd3e6 100644 --- a/libs/libc/stdio/lib_freopen.c +++ b/libs/libc/stdio/lib_freopen.c @@ -106,7 +106,7 @@ FAR FILE *freopen(FAR const char *path, FAR const char *mode, /* Flush the stream and invalidate the read buffer. */ - lib_fflush_unlocked(stream, true); + lib_fflush_unlocked(stream); #ifndef CONFIG_STDIO_DISABLE_BUFFERING lib_rdflush_unlocked(stream); diff --git a/libs/libc/stdio/lib_libfflush.c b/libs/libc/stdio/lib_libfflush.c index 94a8c37a661..2e268a0200a 100644 --- a/libs/libc/stdio/lib_libfflush.c +++ b/libs/libc/stdio/lib_libfflush.c @@ -48,7 +48,6 @@ * * Input Parameters: * stream - the stream to flush - * bforce - flush must be complete. * * Returned Value: * A negated errno value on failure, otherwise the number of bytes remaining @@ -56,7 +55,7 @@ * ****************************************************************************/ -ssize_t lib_fflush_unlocked(FAR FILE *stream, bool bforce) +ssize_t lib_fflush_unlocked(FAR FILE *stream) { #ifndef CONFIG_STDIO_DISABLE_BUFFERING FAR const char *src; @@ -137,7 +136,7 @@ ssize_t lib_fflush_unlocked(FAR FILE *stream, bool bforce) src += bytes_written; nbuffer -= bytes_written; } - while (bforce && nbuffer > 0); + while (nbuffer > 0); /* Reset the buffer position to the beginning of the buffer */ @@ -168,14 +167,14 @@ ssize_t lib_fflush_unlocked(FAR FILE *stream, bool bforce) #endif } -ssize_t lib_fflush(FAR FILE *stream, bool bforce) +ssize_t lib_fflush(FAR FILE *stream) { ssize_t ret; /* Make sure that we have exclusive access to the stream */ flockfile(stream); - ret = lib_fflush_unlocked(stream, bforce); + ret = lib_fflush_unlocked(stream); funlockfile(stream); return ret; } diff --git a/libs/libc/stdio/lib_libflushall.c b/libs/libc/stdio/lib_libflushall.c index 11bda4577de..225482cb3ce 100644 --- a/libs/libc/stdio/lib_libflushall.c +++ b/libs/libc/stdio/lib_libflushall.c @@ -63,7 +63,7 @@ int lib_flushall(FAR struct streamlist *list) for (i = 0; i < 3; i++) { - lib_fflush(&list->sl_std[i], true); + lib_fflush(&list->sl_std[i]); } stream = list->sl_head; @@ -77,7 +77,7 @@ int lib_flushall(FAR struct streamlist *list) { /* Flush the writable FILE */ - ret = lib_fflush(stream, true); + ret = lib_fflush(stream); if (ret < 0) { /* An error occurred during the flush AND/OR we were unable diff --git a/libs/libc/stdio/lib_libfwrite.c b/libs/libc/stdio/lib_libfwrite.c index f5730c4dbea..6e00bb53625 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, true); + int bytes_buffered = lib_fflush_unlocked(stream); if (bytes_buffered < 0) { goto errout; diff --git a/libs/libc/stdio/lib_puts.c b/libs/libc/stdio/lib_puts.c index dfca0942924..f6d45fc458e 100644 --- a/libs/libc/stdio/lib_puts.c +++ b/libs/libc/stdio/lib_puts.c @@ -71,7 +71,7 @@ int puts(FAR const IPTR char *s) if ((stream->fs_flags & __FS_FLAG_LBF) != 0) { - ret = lib_fflush_unlocked(stream, true); + ret = lib_fflush_unlocked(stream); if (ret < 0) { nput = EOF; diff --git a/libs/libc/stdio/lib_wrflush_unlocked.c b/libs/libc/stdio/lib_wrflush_unlocked.c index 7bb9e699ff1..0280ac7959c 100644 --- a/libs/libc/stdio/lib_wrflush_unlocked.c +++ b/libs/libc/stdio/lib_wrflush_unlocked.c @@ -82,7 +82,7 @@ int lib_wrflush_unlocked(FAR FILE *stream) * buffered write data was successfully flushed by lib_fflush(). */ - return lib_fflush_unlocked(stream, true); + return lib_fflush_unlocked(stream); #else /* Verify that we were passed a valid (i.e., non-NULL) stream */ diff --git a/libs/libc/stream/lib_stdoutstream.c b/libs/libc/stream/lib_stdoutstream.c index e168d8e358b..8e168ffa55d 100644 --- a/libs/libc/stream/lib_stdoutstream.c +++ b/libs/libc/stream/lib_stdoutstream.c @@ -113,7 +113,7 @@ static int stdoutstream_flush(FAR struct lib_outstream_s *self) (FAR struct lib_stdoutstream_s *)self; DEBUGASSERT(stream != NULL && stream->handle != NULL); - return lib_fflush(stream->handle, true); + return lib_fflush(stream->handle); } #endif diff --git a/libs/libc/stream/lib_stdsostream.c b/libs/libc/stream/lib_stdsostream.c index 87dbbd1e7ad..02886d68614 100644 --- a/libs/libc/stream/lib_stdsostream.c +++ b/libs/libc/stream/lib_stdsostream.c @@ -112,7 +112,7 @@ static int stdsostream_flush(FAR struct lib_sostream_s *self) (FAR struct lib_stdsostream_s *)self; DEBUGASSERT(stream != NULL && stream->handle != NULL); - return lib_fflush(stream->handle, true); + return lib_fflush(stream->handle); } #endif