diff options
author | Rob Landley | 2006-07-12 19:17:55 +0000 |
---|---|---|
committer | Rob Landley | 2006-07-12 19:17:55 +0000 |
commit | c9c1a41c581101f53cc36efae53cd8ebb568962f (patch) | |
tree | 0aa4024f33e22567444f78d83d7d4b7986abe795 /networking/wget.c | |
parent | 801ab140132a111e9524371c9b8d425579692389 (diff) | |
download | busybox-c9c1a41c581101f53cc36efae53cd8ebb568962f.zip busybox-c9c1a41c581101f53cc36efae53cd8ebb568962f.tar.gz |
A couple things that got tangled up in my tree, easier to check in both than
untangle them:
Rewrite u_signal_names() into get_signum() and get_signame(), plus trim the
signal list to that required by posix (they can specify the numbers for
the rest if they really need them). (This is preparatory cleanup for adding
a timeout applet like Roberto Foglietta wants.)
Export the itoa (added due to Denis Vlasenko, although it's not quite his
preferred implementation) from xfuncs.c so it's actually used, and remove
several other redundant implementations of itoa and utoa() in the tree.
Diffstat (limited to 'networking/wget.c')
-rw-r--r-- | networking/wget.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/networking/wget.c b/networking/wget.c index 64cdf62..6565bb1 100644 --- a/networking/wget.c +++ b/networking/wget.c @@ -697,12 +697,11 @@ updateprogressmeter(int ignore) errno = save_errno; } -static void -alarmtimer(int wait) +static void alarmtimer(int iwait) { struct itimerval itv; - itv.it_value.tv_sec = wait; + itv.it_value.tv_sec = iwait; itv.it_value.tv_usec = 0; itv.it_interval = itv.it_value; setitimer(ITIMER_REAL, &itv, NULL); @@ -715,7 +714,7 @@ progressmeter(int flag) static struct timeval lastupdate; static off_t lastsize, totalsize; - struct timeval now, td, wait; + struct timeval now, td, tvwait; off_t abbrevsize; int elapsed, ratio, barlength, i; char buf[256]; @@ -753,18 +752,18 @@ progressmeter(int flag) /* See http://en.wikipedia.org/wiki/Tera */ fprintf(stderr, "%6d %c%c ", (int)abbrevsize, " KMGTPEZY"[i], i?'B':' '); - timersub(&now, &lastupdate, &wait); + timersub(&now, &lastupdate, &tvwait); if (transferred > lastsize) { lastupdate = now; lastsize = transferred; - if (wait.tv_sec >= STALLTIME) - timeradd(&start, &wait, &start); - wait.tv_sec = 0; + if (tvwait.tv_sec >= STALLTIME) + timeradd(&start, &tvwait, &start); + tvwait.tv_sec = 0; } timersub(&now, &start, &td); elapsed = td.tv_sec; - if (wait.tv_sec >= STALLTIME) { + if (tvwait.tv_sec >= STALLTIME) { fprintf(stderr, " - stalled -"); } else if (transferred <= 0 || elapsed <= 0 || transferred > totalsize || chunked) { fprintf(stderr, "--:--:-- ETA"); |