summaryrefslogtreecommitdiff
path: root/src/stdio/freopen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdio/freopen.c')
-rw-r--r--src/stdio/freopen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/stdio/freopen.c b/src/stdio/freopen.c
index 2bb4420c..c9c28dba 100644
--- a/src/stdio/freopen.c
+++ b/src/stdio/freopen.c
@@ -38,7 +38,7 @@ FILE * freopen(const char * restrict filename, const char * restrict mode, FILE
{ "ab+", O_RDWR | O_CREAT | O_APPEND },
{ "a+b", O_RDWR | O_CREAT | O_APPEND },
};
- int openmode = 0;
+ int openmode = -1;
size_t i;
int fd = -1;
@@ -51,7 +51,7 @@ FILE * freopen(const char * restrict filename, const char * restrict mode, FILE
}
}
- if (openmode == 0) {
+ if (openmode == -1) {
#ifdef EINVAL
errno = EINVAL;
#endif