X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=coreutils%2Ftail.c;h=ff77bde77e69b0ea206d9bea8a270cd850dd72a6;hb=a6ce670a87ee77ccb9337ed6d87442134e1a48ed;hp=dc5918d6b23f31a85f5dd4887248cfa7f404bd81;hpb=eb60d8bcd1ea8f35af23b078e677350b86c1ee8d;p=oweals%2Fbusybox.git diff --git a/coreutils/tail.c b/coreutils/tail.c index dc5918d6b..ff77bde77 100644 --- a/coreutils/tail.c +++ b/coreutils/tail.c @@ -21,24 +21,22 @@ * */ -#include "busybox.h" -#include #include +#include +#include +#include +#include +#include +#include "busybox.h" -static struct suffix_mult tail_suffixes[] = { +static const struct suffix_mult tail_suffixes[] = { { "b", 512 }, { "k", 1024 }, { "m", 1048576 }, { NULL, 0 } }; -#ifndef BB_FEATURE_SIMPLE_TAIL -static struct suffix_mult null_suffixes[] = { - { NULL, 0 } -}; -#endif - static const int BYTES = 0; static const int LINES = 1; @@ -46,14 +44,14 @@ static char *tailbuf; static int taillen; static int newline; -void tailbuf_append(char *buf, int len) +static void tailbuf_append(char *buf, int len) { tailbuf = xrealloc(tailbuf, taillen + len); memcpy(tailbuf + taillen, buf, len); taillen += len; } -void tailbuf_trunc() +static void tailbuf_trunc() { char *s; s = memchr(tailbuf, '\n', taillen); @@ -92,14 +90,14 @@ int tail_main(int argc, char **argv) hide_headers = 1; break; case 's': - sleep_period = parse_number(optarg, null_suffixes); + sleep_period = parse_number(optarg, 0); break; case 'v': show_headers = 1; break; #endif default: - usage(tail_usage); + show_usage(); } }