diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-15 05:40:56 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-15 05:40:56 +0000 |
commit | d50dda8c3501af9d593cd11272a15b480864a01c (patch) | |
tree | 652da97787e8e86f876b647ca9dab4b6b64fe291 /networking/traceroute.c | |
parent | 873b895d50d69a45b52bef85a8a4fb190f9c89ce (diff) |
*: use llist_pop for traverse-and-free list operation
function old new delta
append_file_list_to_list 109 111 +2
udhcpc_main 2414 2413 -1
run_parts_main 325 324 -1
od_main 2324 2323 -1
getopt_main 709 707 -2
env_main 253 251 -2
sed_main 659 656 -3
ps_main 522 519 -3
traceroute_main 3960 3954 -6
sort_main 844 838 -6
diff_main 866 858 -8
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/10 up/down: 2/-33) Total: -31 bytes
Diffstat (limited to 'networking/traceroute.c')
-rw-r--r-- | networking/traceroute.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/networking/traceroute.c b/networking/traceroute.c index e9df27559..6a5373469 100644 --- a/networking/traceroute.c +++ b/networking/traceroute.c @@ -1001,17 +1001,11 @@ int traceroute_main(int argc, char **argv) #if ENABLE_FEATURE_TRACEROUTE_SOURCE_ROUTE if (source_route_list) { - llist_t *l_sr; - - l_sr = source_route_list; - while (l_sr) { + while (source_route_list) { if (lsrr >= NGATEWAYS) bb_error_msg_and_die("no more than %d gateways", NGATEWAYS); - getaddr(gwlist + lsrr, l_sr->data); + getaddr(gwlist + lsrr, llist_pop(&source_route_list)); ++lsrr; - l_sr = l_sr->link; - free(source_route_list); - source_route_list = l_sr; } optlen = (lsrr + 1) * sizeof(gwlist[0]); } |