summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/stdio/freopen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stdio/freopen.c b/src/stdio/freopen.c
index 0afec064..bb3fe198 100644
--- a/src/stdio/freopen.c
+++ b/src/stdio/freopen.c
@@ -70,7 +70,7 @@ FILE * freopen(const char * restrict filename, const char * restrict mode, FILE
if (filename != NULL) {
fd = open(filename, openmode, 0);
- if (fd == -1) {
+ if (fd < 0) {
/* open() already sets errno */
funlockfile(stream);
return NULL;