diff --git a/src/utils.c b/src/utils.c index 4abeb59d9..c8daebb07 100644 --- a/src/utils.c +++ b/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);