aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/udhcp/common.c')
-rw-r--r--networking/udhcp/common.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/networking/udhcp/common.c b/networking/udhcp/common.c
index 3e916f422..3704ba71a 100644
--- a/networking/udhcp/common.c
+++ b/networking/udhcp/common.c
@@ -22,20 +22,6 @@ long uptime(void)
22 return info.uptime; 22 return info.uptime;
23} 23}
24 24
25/*
26 * This function makes sure our first socket calls
27 * aren't going to fd 1 (printf badness...) and are
28 * not later closed by daemon()
29 */
30static inline void sanitize_fds(void)
31{
32 int fd = xopen(bb_dev_null, O_RDWR);
33 while (fd < 3)
34 fd = dup(fd);
35 close(fd);
36}
37
38
39void udhcp_background(const char *pidfile) 25void udhcp_background(const char *pidfile)
40{ 26{
41#ifdef __uClinux__ 27#ifdef __uClinux__
@@ -57,7 +43,7 @@ void udhcp_start_log_and_pid(const char *pidfile)
57 int pid_fd; 43 int pid_fd;
58 44
59 /* Make sure our syslog fd isn't overwritten */ 45 /* Make sure our syslog fd isn't overwritten */
60 sanitize_fds(); 46 bb_sanitize_stdio();
61 47
62 /* do some other misc startup stuff while we are here to save bytes */ 48 /* do some other misc startup stuff while we are here to save bytes */
63 pid_fd = pidfile_acquire(pidfile); 49 pid_fd = pidfile_acquire(pidfile);