Browse Source

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.
Sergey Bugaev 5 years ago
parent
commit
b64cee4589
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Libraries/LibC/stdio.cpp

+ 2 - 2
Libraries/LibC/stdio.cpp

@@ -15,7 +15,7 @@
 
 
 extern "C" {
 extern "C" {
 
 
-static FILE __default_streams[4];
+static FILE __default_streams[3];
 FILE* stdin;
 FILE* stdin;
 FILE* stdout;
 FILE* stdout;
 FILE* stderr;
 FILE* stderr;
@@ -483,7 +483,7 @@ int fclose(FILE* stream)
 {
 {
     fflush(stream);
     fflush(stream);
     int rc = close(stream->fd);
     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);
         free(stream);
     return rc;
     return rc;
 }
 }