From b64cee45898ff8828062d0ddf49c55b2f8c4d7ff Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Tue, 26 Nov 2019 18:44:27 +0300 Subject: [PATCH] LibC: Remove a leftover default_stream Long ago, there was a fourth stdio default stream, stddbg, connected to the debug console. It has since been replaced by the dbgputstr() and dbgputch() syscalls. https://github.com/SerenityOS/serenity/commit/3fce2fb205862b9a06a8e35745e26690f8beed3e Remove the last remains of stddbg, as fd 3 is soon going to be reused for socket takeover. --- Libraries/LibC/stdio.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/LibC/stdio.cpp b/Libraries/LibC/stdio.cpp index 85e30d0fdb..ff5d277a70 100644 --- a/Libraries/LibC/stdio.cpp +++ b/Libraries/LibC/stdio.cpp @@ -15,7 +15,7 @@ extern "C" { -static FILE __default_streams[4]; +static FILE __default_streams[3]; FILE* stdin; FILE* stdout; FILE* stderr; @@ -483,7 +483,7 @@ int fclose(FILE* stream) { fflush(stream); int rc = close(stream->fd); - if (stream != &__default_streams[0] && stream != &__default_streams[1] && stream != &__default_streams[2] && stream != &__default_streams[3]) + if (stream != &__default_streams[0] && stream != &__default_streams[1] && stream != &__default_streams[2]) free(stream); return rc; }