diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2019-06-01 00:39:22 +0300 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2019-06-01 00:39:22 +0300 |
commit | 65c34c52df3ed46f0b811d1858c271a373ab6af5 (patch) | |
tree | 8c9a08f6ff1b442dbb642995d1870cb2efd87a0d /networking/udhcp/dhcpc.c | |
parent | 91755cb16d496d1094f5d81051a1e1e6f27a21c1 (diff) |
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/dhcpc.c')
-rw-r--r-- | networking/udhcp/dhcpc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index cb85fa9e3..f040e93f7 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c @@ -1271,6 +1271,10 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) client_data.sockfd = -1; str_V = "udhcp "BB_VER; + /* Make sure fd 0,1,2 are open */ + /* Set up the signal pipe on fds 3,4 - must be before openlog() */ + udhcp_sp_setup(); + /* Parse command line */ opt = getopt32long(argv, "^" /* O,x: list; -T,-t,-A take numeric param */ @@ -1385,14 +1389,10 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) logmode |= LOGMODE_SYSLOG; } - /* Make sure fd 0,1,2 are open */ - bb_sanitize_stdio(); /* Create pidfile */ write_pidfile(client_data.pidfile); /* Goes to stdout (unless NOMMU) and possibly syslog */ bb_info_msg("started, v"BB_VER); - /* Set up the signal pipe */ - udhcp_sp_setup(); /* We want random_xid to be random... */ srand(monotonic_us()); |