summaryrefslogtreecommitdiff
path: root/networking/udhcp/dhcpc.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-03-17 09:09:09 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-03-17 09:09:09 +0000
commit1d42665b6b0571b9fa5d3b10fbf2dd03382f0ba2 (patch)
tree7ec8969fc2b07a2b7dc37f96435e5eddf7daf7fd /networking/udhcp/dhcpc.c
parent62a90cdd7435f09f4bb8673e8b7b213067f9d5cc (diff)
downloadbusybox-w32-1d42665b6b0571b9fa5d3b10fbf2dd03382f0ba2.tar.gz
busybox-w32-1d42665b6b0571b9fa5d3b10fbf2dd03382f0ba2.tar.bz2
busybox-w32-1d42665b6b0571b9fa5d3b10fbf2dd03382f0ba2.zip
*: shrink: use Vladimir's "o+" specifier instead of xatou(opt_param)
function old new delta getopt32 1370 1385 +15 sulogin_main 490 494 +4 realpath_main 84 86 +2 sleep_main 76 77 +1 mt_main 256 257 +1 printenv_main 75 74 -1 fdformat_main 546 545 -1 usleep_main 44 42 -2 setlogcons_main 77 75 -2 ed_main 2654 2649 -5 deallocvt_main 69 64 -5 addgroup_main 373 368 -5 mkfs_minix_main 2989 2982 -7 tail_main 1221 1213 -8 sv_main 1254 1241 -13 du_main 348 328 -20 tftp_main 325 302 -23 split_main 581 558 -23 nc_main 1000 977 -23 diff_main 891 868 -23 arping_main 1797 1770 -27 ls_main 893 847 -46 od_main 2797 2750 -47 readprofile_main 1944 1895 -49 tcpudpsvd_main 1973 1922 -51 udhcpc_main 2590 2513 -77 grep_main 824 722 -102 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 5/22 up/down: 23/-560) Total: -537 bytes text data bss dec hex filename 796973 658 7428 805059 c48c3 busybox_old 796479 662 7420 804561 c46d1 busybox_unstripped
Diffstat (limited to 'networking/udhcp/dhcpc.c')
-rw-r--r--networking/udhcp/dhcpc.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index 576b1cbb8..fe8f4c8fa 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -132,7 +132,7 @@ int udhcpc_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
132int udhcpc_main(int argc ATTRIBUTE_UNUSED, char **argv) 132int udhcpc_main(int argc ATTRIBUTE_UNUSED, char **argv)
133{ 133{
134 uint8_t *temp, *message; 134 uint8_t *temp, *message;
135 char *str_c, *str_V, *str_h, *str_F, *str_r, *str_T, *str_A, *str_t; 135 char *str_c, *str_V, *str_h, *str_F, *str_r;
136 USE_FEATURE_UDHCP_PORT(char *str_P;) 136 USE_FEATURE_UDHCP_PORT(char *str_P;)
137 llist_t *list_O = NULL; 137 llist_t *list_O = NULL;
138#if ENABLE_FEATURE_UDHCPC_ARPING 138#if ENABLE_FEATURE_UDHCPC_ARPING
@@ -223,7 +223,8 @@ int udhcpc_main(int argc ATTRIBUTE_UNUSED, char **argv)
223 client_config.script = DEFAULT_SCRIPT; 223 client_config.script = DEFAULT_SCRIPT;
224 224
225 /* Parse command line */ 225 /* Parse command line */
226 opt_complementary = "c--C:C--c:O::"; // Cc: mutually exclusive; O: list 226 /* Cc: mutually exclusive; O: list; -T,-t,-A take numeric param */
227 opt_complementary = "c--C:C--c:O::T+:t+:A+";
227#if ENABLE_GETOPT_LONG 228#if ENABLE_GETOPT_LONG
228 applet_long_options = udhcpc_longopts; 229 applet_long_options = udhcpc_longopts;
229#endif 230#endif
@@ -233,7 +234,8 @@ int udhcpc_main(int argc ATTRIBUTE_UNUSED, char **argv)
233 "O:" 234 "O:"
234 , &str_c, &str_V, &str_h, &str_h, &str_F 235 , &str_c, &str_V, &str_h, &str_h, &str_F
235 , &client_config.interface, &client_config.pidfile, &str_r 236 , &client_config.interface, &client_config.pidfile, &str_r
236 , &client_config.script, &str_T, &str_t, &str_A 237 , &client_config.script
238 , &discover_timeout, &discover_retries, &tryagain_timeout
237 USE_FEATURE_UDHCPC_ARPING(, &str_W) 239 USE_FEATURE_UDHCPC_ARPING(, &str_W)
238 USE_FEATURE_UDHCP_PORT(, &str_P) 240 USE_FEATURE_UDHCP_PORT(, &str_P)
239 , &list_O 241 , &list_O
@@ -273,12 +275,9 @@ int udhcpc_main(int argc ATTRIBUTE_UNUSED, char **argv)
273 if (opt & OPT_r) 275 if (opt & OPT_r)
274 requested_ip = inet_addr(str_r); 276 requested_ip = inet_addr(str_r);
275 // if (opt & OPT_s) client_config.script = ... 277 // if (opt & OPT_s) client_config.script = ...
276 if (opt & OPT_T) 278 // if (opt & OPT_T) discover_timeout = xatoi_u(str_T);
277 discover_timeout = xatoi_u(str_T); 279 // if (opt & OPT_t) discover_retries = xatoi_u(str_t);
278 if (opt & OPT_t) 280 // if (opt & OPT_A) tryagain_timeout = xatoi_u(str_A);
279 discover_retries = xatoi_u(str_t);
280 if (opt & OPT_A)
281 tryagain_timeout = xatoi_u(str_A);
282 if (opt & OPT_v) { 281 if (opt & OPT_v) {
283 puts("version "BB_VER); 282 puts("version "BB_VER);
284 return 0; 283 return 0;