diff options
author | Colin Watson <cjwatson@debian.org> | 2005-01-04 13:07:27 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2005-01-04 13:07:27 +0000 |
commit | fd0f611b70a83d80fe8793af785542ee5541b7cd (patch) | |
tree | bededd22bb7eeec52e20083237ab7e4113445a16 /progressmeter.c | |
parent | c44fe9a5b9d3db96a7249b04d915f17e4a3a3b04 (diff) | |
parent | ebd2ce335af5861020c79fddb1ae35c03bf036cf (diff) |
Merge 3.9p1 to the trunk.
Diffstat (limited to 'progressmeter.c')
-rw-r--r-- | progressmeter.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/progressmeter.c b/progressmeter.c index f42668526..93f5a3e62 100644 --- a/progressmeter.c +++ b/progressmeter.c | |||
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | RCSID("$OpenBSD: progressmeter.c,v 1.19 2004/02/05 15:33:33 markus Exp $"); | 26 | RCSID("$OpenBSD: progressmeter.c,v 1.22 2004/07/11 17:48:47 deraadt Exp $"); |
27 | 27 | ||
28 | #include "progressmeter.h" | 28 | #include "progressmeter.h" |
29 | #include "atomicio.h" | 29 | #include "atomicio.h" |
@@ -48,15 +48,15 @@ void refresh_progress_meter(void); | |||
48 | /* signal handler for updating the progress meter */ | 48 | /* signal handler for updating the progress meter */ |
49 | static void update_progress_meter(int); | 49 | static void update_progress_meter(int); |
50 | 50 | ||
51 | static time_t start; /* start progress */ | 51 | static time_t start; /* start progress */ |
52 | static time_t last_update; /* last progress update */ | 52 | static time_t last_update; /* last progress update */ |
53 | static char *file; /* name of the file being transferred */ | 53 | static char *file; /* name of the file being transferred */ |
54 | static off_t end_pos; /* ending position of transfer */ | 54 | static off_t end_pos; /* ending position of transfer */ |
55 | static off_t cur_pos; /* transfer position as of last refresh */ | 55 | static off_t cur_pos; /* transfer position as of last refresh */ |
56 | static volatile off_t *counter; /* progress counter */ | 56 | static volatile off_t *counter; /* progress counter */ |
57 | static long stalled; /* how long we have been stalled */ | 57 | static long stalled; /* how long we have been stalled */ |
58 | static int bytes_per_second; /* current speed in bytes per second */ | 58 | static int bytes_per_second; /* current speed in bytes per second */ |
59 | static int win_size; /* terminal window size */ | 59 | static int win_size; /* terminal window size */ |
60 | 60 | ||
61 | /* units for format_size */ | 61 | /* units for format_size */ |
62 | static const char unit[] = " KMGT"; | 62 | static const char unit[] = " KMGT"; |
@@ -167,7 +167,7 @@ refresh_progress_meter(void) | |||
167 | 167 | ||
168 | /* bandwidth usage */ | 168 | /* bandwidth usage */ |
169 | format_rate(buf + strlen(buf), win_size - strlen(buf), | 169 | format_rate(buf + strlen(buf), win_size - strlen(buf), |
170 | bytes_per_second); | 170 | (off_t)bytes_per_second); |
171 | strlcat(buf, "/s ", win_size); | 171 | strlcat(buf, "/s ", win_size); |
172 | 172 | ||
173 | /* ETA */ | 173 | /* ETA */ |
@@ -224,7 +224,7 @@ update_progress_meter(int ignore) | |||
224 | } | 224 | } |
225 | 225 | ||
226 | void | 226 | void |
227 | start_progress_meter(char *f, off_t filesize, off_t *stat) | 227 | start_progress_meter(char *f, off_t filesize, off_t *ctr) |
228 | { | 228 | { |
229 | struct winsize winsize; | 229 | struct winsize winsize; |
230 | 230 | ||
@@ -232,7 +232,7 @@ start_progress_meter(char *f, off_t filesize, off_t *stat) | |||
232 | file = f; | 232 | file = f; |
233 | end_pos = filesize; | 233 | end_pos = filesize; |
234 | cur_pos = 0; | 234 | cur_pos = 0; |
235 | counter = stat; | 235 | counter = ctr; |
236 | stalled = 0; | 236 | stalled = 0; |
237 | bytes_per_second = 0; | 237 | bytes_per_second = 0; |
238 | 238 | ||