MFC: 1.32: If not compiled for debugging, redirect std{in,out,err}

to /dev/null before becoming a daemon.
This commit is contained in:
ru 2007-10-02 05:44:53 +00:00
parent aecc7cf1b9
commit e8138dad13

View File

@ -127,7 +127,13 @@ main(int argc, char *argv[])
(void) signal(SIGHUP, SIG_IGN);
if (init && daemon(0, 1)) {
if (init && daemon(0,
#ifdef DEBUG
1
#else
0
#endif
)) {
syslog(LOG_ERR, "daemon: %m");
return 1;
}