summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
Diffstat (limited to 'networking')
-rw-r--r--networking/dnsd.c5
-rw-r--r--networking/httpd.c4
-rw-r--r--networking/inetd.c3
-rw-r--r--networking/telnetd.c6
4 files changed, 8 insertions, 10 deletions
diff --git a/networking/dnsd.c b/networking/dnsd.c
index 9c51938..d78ea04 100644
--- a/networking/dnsd.c
+++ b/networking/dnsd.c
@@ -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());
diff --git a/networking/httpd.c b/networking/httpd.c
index fde8ae4..354c199 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -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
diff --git a/networking/inetd.c b/networking/inetd.c
index cc70083..39a2b24 100644
--- a/networking/inetd.c
+++ b/networking/inetd.c
@@ -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: */
diff --git a/networking/telnetd.c b/networking/telnetd.c
index 3e4b42c..d53f56b 100644
--- a/networking/telnetd.c
+++ b/networking/telnetd.c
@@ -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 */