aboutsummaryrefslogtreecommitdiff
path: root/ipsvd
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 /ipsvd
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 'ipsvd')
-rw-r--r--ipsvd/tcpudp.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/ipsvd/tcpudp.c b/ipsvd/tcpudp.c
index 8f23ca640..8f6616fe0 100644
--- a/ipsvd/tcpudp.c
+++ b/ipsvd/tcpudp.c
@@ -163,7 +163,7 @@ static void sig_child_handler(int sig ATTRIBUTE_UNUSED)
163int tcpudpsvd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 163int tcpudpsvd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
164int tcpudpsvd_main(int argc ATTRIBUTE_UNUSED, char **argv) 164int tcpudpsvd_main(int argc ATTRIBUTE_UNUSED, char **argv)
165{ 165{
166 char *str_c, *str_C, *str_b, *str_t; 166 char *str_C, *str_t;
167 char *user; 167 char *user;
168 struct hcc *hccp; 168 struct hcc *hccp;
169 const char *instructs; 169 const char *instructs;
@@ -189,21 +189,20 @@ int tcpudpsvd_main(int argc ATTRIBUTE_UNUSED, char **argv)
189 189
190 tcp = (applet_name[0] == 't'); 190 tcp = (applet_name[0] == 't');
191 191
192 /* 3+ args, -i at most once, -p implies -h, -v is counter */ 192 /* 3+ args, -i at most once, -p implies -h, -v is counter, -b N, -c N */
193 opt_complementary = "-3:i--i:ph:vv"; 193 opt_complementary = "-3:i--i:ph:vv:b+:c+";
194#ifdef SSLSVD 194#ifdef SSLSVD
195 getopt32(argv, "+c:C:i:x:u:l:Eb:hpt:vU:/:Z:K:", 195 getopt32(argv, "+c:C:i:x:u:l:Eb:hpt:vU:/:Z:K:",
196 &str_c, &str_C, &instructs, &instructs, &user, &preset_local_hostname, 196 &cmax, &str_C, &instructs, &instructs, &user, &preset_local_hostname,
197 &str_b, &str_t, &ssluser, &root, &cert, &key, &verbose 197 &backlog, &str_t, &ssluser, &root, &cert, &key, &verbose
198 ); 198 );
199#else 199#else
200 /* "+": stop on first non-option */
200 getopt32(argv, "+c:C:i:x:u:l:Eb:hpt:v", 201 getopt32(argv, "+c:C:i:x:u:l:Eb:hpt:v",
201 &str_c, &str_C, &instructs, &instructs, &user, &preset_local_hostname, 202 &cmax, &str_C, &instructs, &instructs, &user, &preset_local_hostname,
202 &str_b, &str_t, &verbose 203 &backlog, &str_t, &verbose
203 ); 204 );
204#endif 205#endif
205 if (option_mask32 & OPT_c)
206 cmax = xatou_range(str_c, 1, INT_MAX);
207 if (option_mask32 & OPT_C) { /* -C n[:message] */ 206 if (option_mask32 & OPT_C) { /* -C n[:message] */
208 max_per_host = bb_strtou(str_C, &str_C, 10); 207 max_per_host = bb_strtou(str_C, &str_C, 10);
209 if (str_C[0]) { 208 if (str_C[0]) {
@@ -219,8 +218,6 @@ int tcpudpsvd_main(int argc ATTRIBUTE_UNUSED, char **argv)
219 if (!get_uidgid(&ugid, user, 1)) 218 if (!get_uidgid(&ugid, user, 1))
220 bb_error_msg_and_die("unknown user/group: %s", user); 219 bb_error_msg_and_die("unknown user/group: %s", user);
221 } 220 }
222 if (option_mask32 & OPT_b)
223 backlog = xatou(str_b);
224#ifdef SSLSVD 221#ifdef SSLSVD
225 if (option_mask32 & OPT_U) ssluser = optarg; 222 if (option_mask32 & OPT_U) ssluser = optarg;
226 if (option_mask32 & OPT_slash) root = optarg; 223 if (option_mask32 & OPT_slash) root = optarg;