aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-01-27 22:21:12 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-01-27 22:21:12 +0000
commite06bed30cfcde7b9e320aff8a4c878c72416c4c4 (patch)
treeda3276ab5bc224a64fb9f7d7d2a8a046816ec533 /networking/udhcp
parentcd75a96f0f9d446028cad7e4b9b9224e009752e1 (diff)
downloadbusybox-w32-e06bed30cfcde7b9e320aff8a4c878c72416c4c4.tar.gz
busybox-w32-e06bed30cfcde7b9e320aff8a4c878c72416c4c4.tar.bz2
busybox-w32-e06bed30cfcde7b9e320aff8a4c878c72416c4c4.zip
use bb_sanitize_stdio() where appropriate
Diffstat (limited to 'networking/udhcp')
-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);