diff options
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/capability.c | 3 | ||||
-rw-r--r-- | libbb/progress.c | 13 | ||||
-rw-r--r-- | libbb/skip_whitespace.c | 5 |
3 files changed, 17 insertions, 4 deletions
diff --git a/libbb/capability.c b/libbb/capability.c index f60062bfc..6587dcbf7 100644 --- a/libbb/capability.c +++ b/libbb/capability.c | |||
@@ -3,7 +3,8 @@ | |||
3 | * | 3 | * |
4 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 4 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
5 | */ | 5 | */ |
6 | //kbuild:lib-$(CONFIG_PLATFORM_LINUX) += capability.o | 6 | //kbuild:lib-$(CONFIG_FEATURE_SETPRIV_CAPABILITIES) += capability.o |
7 | //kbuild:lib-$(CONFIG_RUN_INIT) += capability.o | ||
7 | 8 | ||
8 | #include <linux/capability.h> | 9 | #include <linux/capability.h> |
9 | // #include <sys/capability.h> | 10 | // #include <sys/capability.h> |
diff --git a/libbb/progress.c b/libbb/progress.c index f1d980d68..23e974ce7 100644 --- a/libbb/progress.c +++ b/libbb/progress.c | |||
@@ -57,6 +57,9 @@ void FAST_FUNC bb_progress_init(bb_progress_t *p, const char *curfile) | |||
57 | p->last_update_sec = p->start_sec; | 57 | p->last_update_sec = p->start_sec; |
58 | p->last_change_sec = p->start_sec; | 58 | p->last_change_sec = p->start_sec; |
59 | p->last_size = 0; | 59 | p->last_size = 0; |
60 | #if 0 | ||
61 | p->last_eta = INT_MAX; | ||
62 | #endif | ||
60 | } | 63 | } |
61 | 64 | ||
62 | /* File already had beg_size bytes. | 65 | /* File already had beg_size bytes. |
@@ -192,6 +195,16 @@ void FAST_FUNC bb_progress_update(bb_progress_t *p, | |||
192 | /* if 32bit, can overflow ^^^^^^^^^^, but this would only show bad ETA */ | 195 | /* if 32bit, can overflow ^^^^^^^^^^, but this would only show bad ETA */ |
193 | if (eta >= 1000*60*60) | 196 | if (eta >= 1000*60*60) |
194 | eta = 1000*60*60 - 1; | 197 | eta = 1000*60*60 - 1; |
198 | #if 0 | ||
199 | /* To prevent annoying "back-and-forth" estimation jitter, | ||
200 | * if new ETA is larger than the last just by a few seconds, | ||
201 | * disregard it, and show last one. The end result is that | ||
202 | * ETA usually only decreases, unless download slows down a lot. | ||
203 | */ | ||
204 | if ((unsigned)(eta - p->last_eta) < 10) | ||
205 | eta = p->last_eta; | ||
206 | p->last_eta = eta; | ||
207 | #endif | ||
195 | secs = eta % 3600; | 208 | secs = eta % 3600; |
196 | hours = eta / 3600; | 209 | hours = eta / 3600; |
197 | fprintf(stderr, "%3u:%02u:%02u ETA", hours, secs / 60, secs % 60); | 210 | fprintf(stderr, "%3u:%02u:%02u ETA", hours, secs / 60, secs % 60); |
diff --git a/libbb/skip_whitespace.c b/libbb/skip_whitespace.c index 4df5d9e4d..37a24d3be 100644 --- a/libbb/skip_whitespace.c +++ b/libbb/skip_whitespace.c | |||
@@ -32,7 +32,6 @@ char* FAST_FUNC skip_non_whitespace(const char *s) | |||
32 | 32 | ||
33 | char* FAST_FUNC skip_dev_pfx(const char *tty_name) | 33 | char* FAST_FUNC skip_dev_pfx(const char *tty_name) |
34 | { | 34 | { |
35 | if (is_prefixed_with(tty_name, "/dev/")) | 35 | char *unprefixed = is_prefixed_with(tty_name, "/dev/"); |
36 | tty_name += 5; | 36 | return unprefixed ? unprefixed : (char*)tty_name; |
37 | return (char*)tty_name; | ||
38 | } | 37 | } |