Daemon: don't use daemon(), always require fork()
Prepare for more advanced daemonization code, which will not work with daemon(). Let's just require fork(). Everybody who supports daemon() also supports fork().
This commit is contained in:
parent
3a6da7c594
commit
56c12bd1ea
@ -153,7 +153,6 @@ fi
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Header/Library Checks
|
||||
dnl ---------------------------------------------------------------------------
|
||||
AC_CHECK_FUNCS(daemon fork)
|
||||
|
||||
AC_SEARCH_LIBS([syslog], [bsd socket inet],
|
||||
[AC_DEFINE(HAVE_SYSLOG, 1, [Define if syslog() is available])])
|
||||
|
@ -137,13 +137,6 @@ daemonize_detach(void)
|
||||
|
||||
fflush(nullptr);
|
||||
|
||||
#ifdef HAVE_DAEMON
|
||||
|
||||
if (daemon(0, 1))
|
||||
FatalSystemError("daemon() failed");
|
||||
|
||||
#elif defined(HAVE_FORK)
|
||||
|
||||
/* detach from parent process */
|
||||
|
||||
switch (fork()) {
|
||||
@ -165,10 +158,6 @@ daemonize_detach(void)
|
||||
|
||||
setsid();
|
||||
|
||||
#else
|
||||
FatalError("no support for daemonizing");
|
||||
#endif
|
||||
|
||||
LogDebug(daemon_domain, "daemonized");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user