diff options
author | Jakob Kaivo <jkk@ung.org> | 2020-08-18 16:12:54 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2020-08-18 16:12:54 -0400 |
commit | 288256939248c6c8f9160f20992b7d70720a989d (patch) | |
tree | f662ea85092ee6ad8e0b4abb826492a5cfcec3e2 /src/stdio | |
parent | 57d205315ced82d9ff346c8112981ff67df24160 (diff) |
handle failure of open() when making syscall directly
Diffstat (limited to 'src/stdio')
-rw-r--r-- | src/stdio/freopen.c | 2 |
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; |