diff options
author | Denis Vlasenko | 2007-08-02 22:31:05 +0000 |
---|---|---|
committer | Denis Vlasenko | 2007-08-02 22:31:05 +0000 |
commit | 80edead5ea731c0c144def4d249eb88fb16001ef (patch) | |
tree | 1aca5341f9b412edd03f9edf32ea5f649a2bf242 /networking/udhcp/dhcpd.c | |
parent | c01af95c398b21203cd991917101e29b21821284 (diff) | |
download | busybox-80edead5ea731c0c144def4d249eb88fb16001ef.zip busybox-80edead5ea731c0c144def4d249eb88fb16001ef.tar.gz |
udhcp: slight shrink
udhcpd_main 1171 1208 +37
udhcpc_main 2363 2387 +24
dhcprelay_main 1145 1146 +1
dhcprelay_stopflag 4 1 -3
dhcprelay_signal_handler 11 8 -3
client_background 46 42 -4
udhcp_read_interface 230 211 -19
udhcp_make_pidfile 76 - -76
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 3/4 up/down: 62/-105) Total: -43 bytes
text data bss dec hex filename
770052 1096 11228 782376 bf028 busybox_old
769980 1096 11228 782304 befe0 busybox_unstripped
Diffstat (limited to 'networking/udhcp/dhcpd.c')
-rw-r--r-- | networking/udhcp/dhcpd.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c index 8cac681..89f57bf 100644 --- a/networking/udhcp/dhcpd.c +++ b/networking/udhcp/dhcpd.c @@ -51,7 +51,16 @@ int udhcpd_main(int argc, char **argv) * otherwise NOMMU machines will parse config twice */ read_config(argv[1] ? argv[1] : DHCPD_CONF_FILE); - udhcp_make_pidfile(server_config.pidfile); + /* Make sure fd 0,1,2 are open */ + bb_sanitize_stdio(); + /* Equivalent of doing a fflush after every \n */ + setlinebuf(stdout); + + /* Create pidfile */ + write_pidfile(server_config.pidfile); + /* if (!..) bb_perror_msg("cannot create pidfile %s", pidfile); */ + + bb_info_msg("%s (v%s) started", applet_name, BB_VER); option = find_option(server_config.options, DHCP_LEASE_TIME); server_config.lease = LEASE_TIME; @@ -72,7 +81,7 @@ int udhcpd_main(int argc, char **argv) read_leases(server_config.lease_file); if (read_interface(server_config.interface, &server_config.ifindex, - &server_config.server, server_config.arp) < 0) { + &server_config.server, server_config.arp)) { retval = 1; goto ret; } |