Skip to content

Commit

Permalink
sys/fs: fix check for negative return value
Browse files Browse the repository at this point in the history
  • Loading branch information
sreimers committed Feb 27, 2022
1 parent 5821855 commit 6153d7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sys/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ int fs_fopen(FILE **fp, const char *file, const char *mode)
goto fopen;

fd = open(file, O_WRONLY | O_CREAT, S_IWUSR | S_IRUSR);
if (!fd)
if (fd == -1)
return errno;
else
(void)close(fd);
Expand Down

0 comments on commit 6153d7e

Please sign in to comment.