- patch from Denis Vlasenko to add and use bb_xdaemon()
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
* Copyright (C) 2005 Roberto A. Foglietta (me@roberto.foglietta.name)
|
||||
* Copyright (C) 2005 Odd Arild Olsen (oao at fibula dot no)
|
||||
* Copyright (C) 2003 Paul Sheer
|
||||
*
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
|
||||
*
|
||||
* Odd Arild Olsen started out with the sheerdns [1] of Paul Sheer and rewrote
|
||||
@@ -408,9 +409,7 @@ int dnsd_main(int argc, char **argv)
|
||||
/* reexec for vfork() do continue parent */
|
||||
vfork_daemon_rexec(1, 0, argc, argv, "-d");
|
||||
#else /* uClinux */
|
||||
if (daemon(1, 0) < 0) {
|
||||
bb_perror_msg_and_die("daemon");
|
||||
}
|
||||
bb_xdaemon(1, 0);
|
||||
#endif /* uClinuvx */
|
||||
|
||||
dnsentryinit(is_verbose());
|
||||
|
@@ -1,3 +1,4 @@
|
||||
/* vi: set sw=4 ts=4: */
|
||||
/*
|
||||
* httpd implementation for busybox
|
||||
*
|
||||
@@ -2114,8 +2115,7 @@ int httpd_main(int argc, char *argv[])
|
||||
|
||||
#if !ENABLE_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY
|
||||
# if !DEBUG
|
||||
if (daemon(1, 0) < 0) /* don`t change curent directory */
|
||||
bb_perror_msg_and_die("daemon");
|
||||
bb_xdaemon(1, 0); /* don`t change curent directory */
|
||||
# endif
|
||||
return miniHttpd(server);
|
||||
#else
|
||||
|
@@ -1314,7 +1314,7 @@ inetd_main (int argc, char *argv[])
|
||||
/* reexec for vfork() do continue parent */
|
||||
vfork_daemon_rexec (0, 0, argc, argv, "-f");
|
||||
#else
|
||||
daemon (0, 0);
|
||||
daemon (0, 0); /* bb_xdaemon? */
|
||||
#endif /* uClinux */
|
||||
} else {
|
||||
setsid ();
|
||||
@@ -1802,3 +1802,4 @@ daytime_dg (int s, servtab_t *sep ATTRIBUTE_UNUSED)
|
||||
(void) sendto (s, buffer, strlen (buffer), 0, &sa, sizeof (sa));
|
||||
}
|
||||
#endif /* CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME */
|
||||
/* vi: set sw=4 ts=4: */
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* vi:set ts=4:*/
|
||||
/* vi: set sw=4 ts=4: */
|
||||
/*
|
||||
* Simple telnet server
|
||||
* Bjorn Wesen, Axis Communications AB (bjornw@axis.com)
|
||||
@@ -469,9 +469,7 @@ telnetd_main(int argc, char **argv)
|
||||
bb_perror_msg_and_die("listen");
|
||||
}
|
||||
|
||||
if (daemon(0, 0) < 0)
|
||||
bb_perror_msg_and_die("daemon");
|
||||
|
||||
bb_xdaemon(0, 0);
|
||||
|
||||
maxfd = master_fd;
|
||||
#endif /* CONFIG_FEATURE_TELNETD_INETD */
|
||||
|
Reference in New Issue
Block a user