diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2019-05-31 23:39:22 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2019-05-31 23:39:22 +0200 |
commit | 65c34c52df3ed46f0b811d1858c271a373ab6af5 (patch) | |
tree | 8c9a08f6ff1b442dbb642995d1870cb2efd87a0d /networking/udhcp/dhcpc.c | |
parent | 91755cb16d496d1094f5d81051a1e1e6f27a21c1 (diff) | |
download | busybox-w32-65c34c52df3ed46f0b811d1858c271a373ab6af5.tar.gz busybox-w32-65c34c52df3ed46f0b811d1858c271a373ab6af5.tar.bz2 busybox-w32-65c34c52df3ed46f0b811d1858c271a373ab6af5.zip |
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) | |||
1271 | client_data.sockfd = -1; | 1271 | client_data.sockfd = -1; |
1272 | str_V = "udhcp "BB_VER; | 1272 | str_V = "udhcp "BB_VER; |
1273 | 1273 | ||
1274 | /* Make sure fd 0,1,2 are open */ | ||
1275 | /* Set up the signal pipe on fds 3,4 - must be before openlog() */ | ||
1276 | udhcp_sp_setup(); | ||
1277 | |||
1274 | /* Parse command line */ | 1278 | /* Parse command line */ |
1275 | opt = getopt32long(argv, "^" | 1279 | opt = getopt32long(argv, "^" |
1276 | /* O,x: list; -T,-t,-A take numeric param */ | 1280 | /* O,x: list; -T,-t,-A take numeric param */ |
@@ -1385,14 +1389,10 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) | |||
1385 | logmode |= LOGMODE_SYSLOG; | 1389 | logmode |= LOGMODE_SYSLOG; |
1386 | } | 1390 | } |
1387 | 1391 | ||
1388 | /* Make sure fd 0,1,2 are open */ | ||
1389 | bb_sanitize_stdio(); | ||
1390 | /* Create pidfile */ | 1392 | /* Create pidfile */ |
1391 | write_pidfile(client_data.pidfile); | 1393 | write_pidfile(client_data.pidfile); |
1392 | /* Goes to stdout (unless NOMMU) and possibly syslog */ | 1394 | /* Goes to stdout (unless NOMMU) and possibly syslog */ |
1393 | bb_info_msg("started, v"BB_VER); | 1395 | bb_info_msg("started, v"BB_VER); |
1394 | /* Set up the signal pipe */ | ||
1395 | udhcp_sp_setup(); | ||
1396 | /* We want random_xid to be random... */ | 1396 | /* We want random_xid to be random... */ |
1397 | srand(monotonic_us()); | 1397 | srand(monotonic_us()); |
1398 | 1398 | ||