diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2015-10-14 13:21:01 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2015-10-14 13:21:01 +0200 |
commit | 0f296a3a56b52842057e5a2bc653621a3a6c7bec (patch) | |
tree | c504475cbf18d845698097e6b3b9656e0040d373 /networking/tc.c | |
parent | 69934701fd1b18327b3a779cb292a728834b2d0d (diff) | |
download | busybox-w32-0f296a3a56b52842057e5a2bc653621a3a6c7bec.tar.gz busybox-w32-0f296a3a56b52842057e5a2bc653621a3a6c7bec.tar.bz2 busybox-w32-0f296a3a56b52842057e5a2bc653621a3a6c7bec.zip |
libiproute: rename invarg(a,b) to invarg_1_to_2(a,b)
invarg(a,b) - "invalid argument", but how a and b enter the message?
invarg_1_to_2(a,b) is somewhat easier to read: "invalid argument 'a' to 'b'"
Audit of usage revealed a number of bad uses, with too long messages.
text data bss dec hex filename
938848 932 17448 957228 e9b2c busybox_old
938788 932 17448 957168 e9af0 busybox_unstripped
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/tc.c')
-rw-r--r-- | networking/tc.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/networking/tc.c b/networking/tc.c index 6d1fef993..c84c18a67 100644 --- a/networking/tc.c +++ b/networking/tc.c | |||
@@ -459,14 +459,14 @@ int tc_main(int argc UNUSED_PARAM, char **argv) | |||
459 | 459 | ||
460 | obj = index_in_substrings(objects, *argv++); | 460 | obj = index_in_substrings(objects, *argv++); |
461 | 461 | ||
462 | if (obj < OBJ_qdisc) | 462 | if (obj < 0) |
463 | bb_show_usage(); | 463 | bb_show_usage(); |
464 | if (!*argv) | 464 | if (!*argv) |
465 | cmd = CMD_show; /* list is the default */ | 465 | cmd = CMD_show; /* list is the default */ |
466 | else { | 466 | else { |
467 | cmd = index_in_substrings(commands, *argv); | 467 | cmd = index_in_substrings(commands, *argv); |
468 | if (cmd < 0) | 468 | if (cmd < 0) |
469 | bb_error_msg_and_die(bb_msg_invalid_arg, *argv, applet_name); | 469 | invarg_1_to_2(*argv, argv[-1]); |
470 | argv++; | 470 | argv++; |
471 | } | 471 | } |
472 | memset(&msg, 0, sizeof(msg)); | 472 | memset(&msg, 0, sizeof(msg)); |
@@ -489,7 +489,7 @@ int tc_main(int argc UNUSED_PARAM, char **argv) | |||
489 | NEXT_ARG(); | 489 | NEXT_ARG(); |
490 | /* We don't care about duparg2("qdisc handle",*argv) for now */ | 490 | /* We don't care about duparg2("qdisc handle",*argv) for now */ |
491 | if (get_qdisc_handle(&filter_qdisc, *argv)) | 491 | if (get_qdisc_handle(&filter_qdisc, *argv)) |
492 | invarg(*argv, "qdisc"); | 492 | invarg_1_to_2(*argv, "qdisc"); |
493 | } else | 493 | } else |
494 | if (obj != OBJ_qdisc | 494 | if (obj != OBJ_qdisc |
495 | && (arg == ARG_root | 495 | && (arg == ARG_root |
@@ -499,7 +499,7 @@ int tc_main(int argc UNUSED_PARAM, char **argv) | |||
499 | ) { | 499 | ) { |
500 | /* nothing */ | 500 | /* nothing */ |
501 | } else { | 501 | } else { |
502 | invarg(*argv, "command"); | 502 | invarg_1_to_2(*argv, "command"); |
503 | } | 503 | } |
504 | NEXT_ARG(); | 504 | NEXT_ARG(); |
505 | if (arg == ARG_root) { | 505 | if (arg == ARG_root) { |
@@ -513,7 +513,7 @@ int tc_main(int argc UNUSED_PARAM, char **argv) | |||
513 | if (msg.tcm_parent) | 513 | if (msg.tcm_parent) |
514 | duparg(*argv, "parent"); | 514 | duparg(*argv, "parent"); |
515 | if (get_tc_classid(&handle, *argv)) | 515 | if (get_tc_classid(&handle, *argv)) |
516 | invarg(*argv, "parent"); | 516 | invarg_1_to_2(*argv, "parent"); |
517 | msg.tcm_parent = handle; | 517 | msg.tcm_parent = handle; |
518 | if (obj == OBJ_filter) | 518 | if (obj == OBJ_filter) |
519 | filter_parent = handle; | 519 | filter_parent = handle; |
@@ -538,7 +538,7 @@ int tc_main(int argc UNUSED_PARAM, char **argv) | |||
538 | if (filter_proto) | 538 | if (filter_proto) |
539 | duparg(*argv, "protocol"); | 539 | duparg(*argv, "protocol"); |
540 | if (ll_proto_a2n(&tmp, *argv)) | 540 | if (ll_proto_a2n(&tmp, *argv)) |
541 | invarg(*argv, "protocol"); | 541 | invarg_1_to_2(*argv, "protocol"); |
542 | filter_proto = tmp; | 542 | filter_proto = tmp; |
543 | } | 543 | } |
544 | } | 544 | } |