summaryrefslogtreecommitdiff
path: root/src/stdio
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2020-08-18 16:12:54 -0400
committerJakob Kaivo <jkk@ung.org>2020-08-18 16:12:54 -0400
commit288256939248c6c8f9160f20992b7d70720a989d (patch)
treef662ea85092ee6ad8e0b4abb826492a5cfcec3e2 /src/stdio
parent57d205315ced82d9ff346c8112981ff67df24160 (diff)
handle failure of open() when making syscall directly
Diffstat (limited to 'src/stdio')
-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;