From bf89077e024790649ff2150a7659926129699d13 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Sun, 24 Nov 2024 19:19:06 +0100 Subject: libc: fclose should always close the associated file descriptor My previous "fix" was a misreading of the spec. --- userland/libc/stdio/fclose.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/userland/libc/stdio/fclose.c b/userland/libc/stdio/fclose.c index 5d66830..9e95b0b 100644 --- a/userland/libc/stdio/fclose.c +++ b/userland/libc/stdio/fclose.c @@ -9,9 +9,7 @@ int fclose(FILE *stream) { if (stream->fflush) { stream->fflush(stream); } - if (stream->has_control_over_the_fd) { - close(stream->fd); - } + close(stream->fd); free(stream->cookie); } free(stream); -- cgit v1.2.3