diff options
Diffstat (limited to 'userland/libc/stdio/fclose.c')
-rw-r--r-- | userland/libc/stdio/fclose.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/userland/libc/stdio/fclose.c b/userland/libc/stdio/fclose.c index 01bdb22..eb92387 100644 --- a/userland/libc/stdio/fclose.c +++ b/userland/libc/stdio/fclose.c @@ -4,8 +4,12 @@ // https://pubs.opengroup.org/onlinepubs/9699919799/functions/fclose.html // FIXME: Do some actual error checking. int fclose(FILE *stream) { - if (stream) + if (stream) { + if (stream->fflush) { + stream->fflush(stream); + } free(stream->cookie); + } free(stream); return 0; } |