Browse Source

fix check for return value of open when redirecting to null device

pull/2842/head
Gilles Depeyrot 3 years ago
committed by Max Lv
parent
commit
8bcffa54b5
1 changed files with 1 additions and 1 deletions
  1. 2
      src/utils.c

2
src/utils.c

@ -484,7 +484,7 @@ daemonize(const char *path)
}
int dev_null = open("/dev/null", O_WRONLY);
if (dev_null) {
if (dev_null > 0) {
/* Redirect to null device */
dup2(dev_null, STDOUT_FILENO);
dup2(dev_null, STDERR_FILENO);

Loading…
Cancel
Save