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/dhcpd.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/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 6e426e6a2..022b8721b 100644 --- a/networking/udhcp/dhcpd.c +++ b/networking/udhcp/dhcpd.c | |||
@@ -37,6 +37,8 @@ | |||
37 | //usage: IF_FEATURE_UDHCP_PORT( | 37 | //usage: IF_FEATURE_UDHCP_PORT( |
38 | //usage: "\n -P N Use port N (default 67)" | 38 | //usage: "\n -P N Use port N (default 67)" |
39 | //usage: ) | 39 | //usage: ) |
40 | //usage: "\nSignals:" | ||
41 | //usage: "\n USR1 Update lease file" | ||
40 | 42 | ||
41 | #include <netinet/ether.h> | 43 | #include <netinet/ether.h> |
42 | #include <syslog.h> | 44 | #include <syslog.h> |
@@ -863,6 +865,10 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv) | |||
863 | IF_FEATURE_UDHCP_PORT(SERVER_PORT = 67;) | 865 | IF_FEATURE_UDHCP_PORT(SERVER_PORT = 67;) |
864 | IF_FEATURE_UDHCP_PORT(CLIENT_PORT = 68;) | 866 | IF_FEATURE_UDHCP_PORT(CLIENT_PORT = 68;) |
865 | 867 | ||
868 | /* Make sure fd 0,1,2 are open */ | ||
869 | /* Setup the signal pipe on fds 3,4 - must be before openlog() */ | ||
870 | udhcp_sp_setup(); | ||
871 | |||
866 | opt = getopt32(argv, "^" | 872 | opt = getopt32(argv, "^" |
867 | "fSI:va:"IF_FEATURE_UDHCP_PORT("P:") | 873 | "fSI:va:"IF_FEATURE_UDHCP_PORT("P:") |
868 | "\0" | 874 | "\0" |
@@ -904,9 +910,6 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv) | |||
904 | if (server_data.auto_time > INT_MAX / 1000) | 910 | if (server_data.auto_time > INT_MAX / 1000) |
905 | server_data.auto_time = INT_MAX / 1000; | 911 | server_data.auto_time = INT_MAX / 1000; |
906 | 912 | ||
907 | /* Make sure fd 0,1,2 are open */ | ||
908 | bb_sanitize_stdio(); | ||
909 | |||
910 | /* Create pidfile */ | 913 | /* Create pidfile */ |
911 | write_pidfile(server_data.pidfile); | 914 | write_pidfile(server_data.pidfile); |
912 | /* if (!..) bb_perror_msg("can't create pidfile %s", pidfile); */ | 915 | /* if (!..) bb_perror_msg("can't create pidfile %s", pidfile); */ |
@@ -942,9 +945,6 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv) | |||
942 | goto ret; | 945 | goto ret; |
943 | } | 946 | } |
944 | 947 | ||
945 | /* Setup the signal pipe */ | ||
946 | udhcp_sp_setup(); | ||
947 | |||
948 | continue_with_autotime: | 948 | continue_with_autotime: |
949 | timeout_end = monotonic_sec() + server_data.auto_time; | 949 | timeout_end = monotonic_sec() + server_data.auto_time; |
950 | while (1) { /* loop until universe collapses */ | 950 | while (1) { /* loop until universe collapses */ |