|
@@ -32,9 +32,9 @@ void daemonize(char *pidfile) {
|
32
|
32
|
}
|
33
|
33
|
// Child process continues...
|
34
|
34
|
setsid(); // request a new session (job control)
|
35
|
|
- freopen("/dev/null", "r", stdin);
|
36
|
|
- freopen("/dev/null", "w", stdout);
|
37
|
|
- freopen("/dev/null", "w", stderr);
|
|
35
|
+ if (!freopen("/dev/null", "r", stdin)) return;
|
|
36
|
+ if (!freopen("/dev/null", "w", stdout)) return;
|
|
37
|
+ if (!freopen("/dev/null", "w", stderr)) return;
|
38
|
38
|
}
|
39
|
39
|
|
40
|
40
|
void init_server_socket(char *bind_addr, int bind_port, struct sockaddr_in *server, int *server_socket) {
|