Fix use of freopen
authorMichael Spang <mspang@csclub.uwaterloo.ca>
Mon, 2 Nov 2009 20:41:29 +0000 (15:41 -0500)
committerMichael Spang <mspang@csclub.uwaterloo.ca>
Mon, 2 Nov 2009 20:41:29 +0000 (15:41 -0500)
src/dmaster.c

index be5c9b5..2835a43 100644 (file)
@@ -103,9 +103,9 @@ static void setup_daemon(void) {
 
         setup_pidfile();
 
-        freopen("/dev/null", "r", stdin);
-        freopen("/dev/null", "w", stdout);
-        freopen("/dev/null", "w", stderr);
+        stdin = freopen("/dev/null", "r", stdin);
+        stdout = freopen("/dev/null", "w", stdout);
+        stderr = freopen("/dev/null", "w", stderr);
     }
 }