mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-31 12:13:10 +00:00
If not compiled for debugging, redirect standard input/output/error
to /dev/null before becoming a daemon.
This commit is contained in:
parent
66adc12877
commit
cc17b04460
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=163628
@ -126,7 +126,13 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
(void) signal(SIGHUP, SIG_IGN);
|
(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");
|
syslog(LOG_ERR, "daemon: %m");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user