mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-10-28 11:43:50 +00:00
fix check for return value of open when redirecting to null device
This commit is contained in:
+1
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user