fix integer overflow in WIFSTOPPED macro
[musl] / src / stdio / freopen.c
index 6d6d21d..1641a4c 100644 (file)
@@ -1,7 +1,6 @@
 #include "stdio_impl.h"
 #include <fcntl.h>
 #include <unistd.h>
-#include "libc.h"
 
 /* The basic idea of this implementation is to open a new FILE,
  * hack the necessary parts of the new FILE into the old one, then
@@ -41,6 +40,8 @@ FILE *freopen(const char *restrict filename, const char *restrict mode, FILE *re
                fclose(f2);
        }
 
+       f->mode = 0;
+       f->locale = 0;
        FUNLOCK(f);
        return f;
 
@@ -50,5 +51,3 @@ fail:
        fclose(f);
        return NULL;
 }
-
-LFS64(freopen);