diff --git a/DaemonLinux.cpp b/DaemonLinux.cpp index 53d9f61e..59c286be 100644 --- a/DaemonLinux.cpp +++ b/DaemonLinux.cpp @@ -64,12 +64,9 @@ namespace i2p } // close stdin/stdout/stderr descriptors - ::close (0); - ::open ("/dev/null", O_RDWR); - ::close (1); - ::open ("/dev/null", O_RDWR); - ::close (2); - ::open ("/dev/null", O_RDWR); + freopen("/dev/null", "r", stdin); + freopen("/dev/null", "w", stdout); + freopen("/dev/null", "w", stderr); } // Pidfile