diff options
author | Denys Vlasenko | 2019-05-31 23:39:22 +0200 |
---|---|---|
committer | Denys Vlasenko | 2019-05-31 23:39:22 +0200 |
commit | 65c34c52df3ed46f0b811d1858c271a373ab6af5 (patch) | |
tree | 8c9a08f6ff1b442dbb642995d1870cb2efd87a0d /networking/udhcp/dhcpd.c | |
parent | 91755cb16d496d1094f5d81051a1e1e6f27a21c1 (diff) | |
download | busybox-65c34c52df3ed46f0b811d1858c271a373ab6af5.zip busybox-65c34c52df3ed46f0b811d1858c271a373ab6af5.tar.gz |
dhcp: get rid of static data signal_pipe
function old new delta
udhcp_sp_setup 65 110 +45
udhcp_sp_fd_set 60 59 -1
udhcpd_main 1442 1437 -5
udhcpc_main 2684 2679 -5
signal_pipe 8 - -8
packed_usage 33292 33284 -8
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/4 up/down: 45/-27) Total: 18 bytes
text data bss dec hex filename
952746 481 7296 960523 ea80b busybox_old
952768 481 7288 960537 ea819 busybox_unstripped
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp/dhcpd.c')
-rw-r--r-- | networking/udhcp/dhcpd.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c index 6e426e6..022b872 100644 --- a/networking/udhcp/dhcpd.c +++ b/networking/udhcp/dhcpd.c @@ -37,6 +37,8 @@ //usage: IF_FEATURE_UDHCP_PORT( //usage: "\n -P N Use port N (default 67)" //usage: ) +//usage: "\nSignals:" +//usage: "\n USR1 Update lease file" #include <netinet/ether.h> #include <syslog.h> @@ -863,6 +865,10 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv) IF_FEATURE_UDHCP_PORT(SERVER_PORT = 67;) IF_FEATURE_UDHCP_PORT(CLIENT_PORT = 68;) + /* Make sure fd 0,1,2 are open */ + /* Setup the signal pipe on fds 3,4 - must be before openlog() */ + udhcp_sp_setup(); + opt = getopt32(argv, "^" "fSI:va:"IF_FEATURE_UDHCP_PORT("P:") "\0" @@ -904,9 +910,6 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv) if (server_data.auto_time > INT_MAX / 1000) server_data.auto_time = INT_MAX / 1000; - /* Make sure fd 0,1,2 are open */ - bb_sanitize_stdio(); - /* Create pidfile */ write_pidfile(server_data.pidfile); /* if (!..) bb_perror_msg("can't create pidfile %s", pidfile); */ @@ -942,9 +945,6 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv) goto ret; } - /* Setup the signal pipe */ - udhcp_sp_setup(); - continue_with_autotime: timeout_end = monotonic_sec() + server_data.auto_time; while (1) { /* loop until universe collapses */ |