aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-09-03 12:31:59 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-09-03 12:31:59 +0000
commit65113e8d97c62b6aed560ac73961c8a9020c1568 (patch)
tree26e63486b8cbf79dd02a939fe5475a03baa95853
parentaf906a3b6ca6e2ae098ed2b3beb34db351d2eae8 (diff)
downloadbusybox-w32-65113e8d97c62b6aed560ac73961c8a9020c1568.tar.gz
busybox-w32-65113e8d97c62b6aed560ac73961c8a9020c1568.tar.bz2
busybox-w32-65113e8d97c62b6aed560ac73961c8a9020c1568.zip
zcip: bb_error_msg had stray newlines; small optimization in opt parsing
-rw-r--r--networking/zcip.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/networking/zcip.c b/networking/zcip.c
index a7f19d5db..3a08382c2 100644
--- a/networking/zcip.c
+++ b/networking/zcip.c
@@ -171,7 +171,7 @@ static int run(char *script, char *arg, char *intf, struct in_addr *ip)
171 } 171 }
172 if (WEXITSTATUS(status) != 0) { 172 if (WEXITSTATUS(status) != 0) {
173 if (FOREGROUND) 173 if (FOREGROUND)
174 bb_error_msg("script %s failed, exit=%d\n", 174 bb_error_msg("script %s failed, exit=%d",
175 script, WEXITSTATUS(status)); 175 script, WEXITSTATUS(status));
176 else 176 else
177 syslog(LOG_ERR, "script %s failed, exit=%d", 177 syslog(LOG_ERR, "script %s failed, exit=%d",
@@ -233,7 +233,7 @@ int zcip_main(int argc, char *argv[])
233 233
234 // parse commandline: prog [options] ifname script 234 // parse commandline: prog [options] ifname script
235 char *r_opt; 235 char *r_opt;
236 bb_opt_complementally = "vv"; // -v options accumulate 236 bb_opt_complementally = "vv:vf"; // -v accumulates and implies -f
237 opts = bb_getopt_ulflags(argc, argv, "fqr:v", &r_opt, &verbose); 237 opts = bb_getopt_ulflags(argc, argv, "fqr:v", &r_opt, &verbose);
238 if (opts & 4) { // -r n.n.n.n 238 if (opts & 4) { // -r n.n.n.n
239 if (inet_aton(r_opt, &ip) == 0 239 if (inet_aton(r_opt, &ip) == 0
@@ -241,7 +241,6 @@ int zcip_main(int argc, char *argv[])
241 bb_error_msg_and_die("invalid link address"); 241 bb_error_msg_and_die("invalid link address");
242 } 242 }
243 } 243 }
244 if (verbose) opts |= 1; // -v implies -f
245 argc -= optind; 244 argc -= optind;
246 argv += optind; 245 argv += optind;
247 if (argc != 2) 246 if (argc != 2)
@@ -442,7 +441,7 @@ int zcip_main(int argc, char *argv[])
442 if (fds[0].revents & POLLERR) { 441 if (fds[0].revents & POLLERR) {
443 // FIXME: links routinely go down; 442 // FIXME: links routinely go down;
444 // this shouldn't necessarily exit. 443 // this shouldn't necessarily exit.
445 bb_error_msg("%s: poll error\n", intf); 444 bb_error_msg("%s: poll error", intf);
446 if (ready) { 445 if (ready) {
447 run(script, "deconfig", 446 run(script, "deconfig",
448 intf, &ip); 447 intf, &ip);