diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-18 08:55:57 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-18 08:55:57 +0000 |
commit | 7679145cfa61e41099645bdeecb6a8c2743c6772 (patch) | |
tree | f130799bb1bd2f0721cb832c2dcee92b8d80c2ce /networking/wget.c | |
parent | ebd27aabaab98bef2f2d0fe0d7bf4261e5c3ffcd (diff) | |
download | busybox-w32-7679145cfa61e41099645bdeecb6a8c2743c6772.tar.gz busybox-w32-7679145cfa61e41099645bdeecb6a8c2743c6772.tar.bz2 busybox-w32-7679145cfa61e41099645bdeecb6a8c2743c6772.zip |
ping: fix write-after-allocated-mem bug
ping: use monotonic_us instead of gettimeofday: smaller code and
needs only 4 bytes in the packet
ping: display roundtrip times with 1/1000th of ms, not 1/10 ms precision.
wget: small optimization
function old new delta
pingstats 243 259 +16
sendping6 98 93 -5
sendping4 183 178 -5
.rodata 129715 129707 -8
progressmeter 867 855 -12
unpack_tail 320 272 -48
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/5 up/down: 16/-78) Total: -62 bytes
Diffstat (limited to 'networking/wget.c')
-rw-r--r-- | networking/wget.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/networking/wget.c b/networking/wget.c index 8be37a744..ef27ab058 100644 --- a/networking/wget.c +++ b/networking/wget.c | |||
@@ -8,7 +8,7 @@ | |||
8 | 8 | ||
9 | /* We want libc to give us xxx64 functions also */ | 9 | /* We want libc to give us xxx64 functions also */ |
10 | /* http://www.unix.org/version2/whatsnew/lfs20mar.html */ | 10 | /* http://www.unix.org/version2/whatsnew/lfs20mar.html */ |
11 | #define _LARGEFILE64_SOURCE 1 | 11 | //#define _LARGEFILE64_SOURCE 1 |
12 | 12 | ||
13 | #include <getopt.h> /* for struct option */ | 13 | #include <getopt.h> /* for struct option */ |
14 | #include "libbb.h" | 14 | #include "libbb.h" |
@@ -710,7 +710,7 @@ progressmeter(int flag) | |||
710 | 710 | ||
711 | fprintf(stderr, "\r%-20.20s%4d%% ", curfile, ratio); | 711 | fprintf(stderr, "\r%-20.20s%4d%% ", curfile, ratio); |
712 | 712 | ||
713 | barlength = getttywidth() - 51; | 713 | barlength = getttywidth() - 49; |
714 | if (barlength > 0) { | 714 | if (barlength > 0) { |
715 | /* god bless gcc for variable arrays :) */ | 715 | /* god bless gcc for variable arrays :) */ |
716 | i = barlength * ratio / 100; | 716 | i = barlength * ratio / 100; |
@@ -728,7 +728,7 @@ progressmeter(int flag) | |||
728 | abbrevsize >>= 10; | 728 | abbrevsize >>= 10; |
729 | } | 729 | } |
730 | /* see http://en.wikipedia.org/wiki/Tera */ | 730 | /* see http://en.wikipedia.org/wiki/Tera */ |
731 | fprintf(stderr, "%6d %c%c ", (int)abbrevsize, " KMGTPEZY"[i], i?'B':' '); | 731 | fprintf(stderr, "%6d%c ", (int)abbrevsize, " kMGTPEZY"[i]); |
732 | 732 | ||
733 | // Nuts! Ain't it easier to update progress meter ONLY when we transferred++? | 733 | // Nuts! Ain't it easier to update progress meter ONLY when we transferred++? |
734 | // FIXME: get rid of alarmtimer + updateprogressmeter mess | 734 | // FIXME: get rid of alarmtimer + updateprogressmeter mess |