Skip to content

Commit

Permalink
sys/fs: fs_stdio_hide check negative return value
Browse files Browse the repository at this point in the history
  • Loading branch information
sreimers committed Jun 4, 2023
1 parent 1001ded commit 01bf02d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/sys/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ void fs_stdio_hide(void)
#else
int fd = open("/dev/null", O_WRONLY);
#endif
if (fd < 0)
return;

(void)dup2(fd, fileno(stdout));
(void)dup2(fd, fileno(stderr));

Expand Down

0 comments on commit 01bf02d

Please sign in to comment.