projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix warning
[oweals/busybox.git]
/
tail.c
diff --git
a/tail.c
b/tail.c
index d45b29c4c082cec6453ddfc0b366af1af91d2244..ff77bde77e69b0ea206d9bea8a270cd850dd72a6 100644
(file)
--- a/
tail.c
+++ b/
tail.c
@@
-21,7
+21,6
@@
*
*/
*
*/
-#include "busybox.h"
#include <fcntl.h>
#include <getopt.h>
#include <fcntl.h>
#include <getopt.h>
@@
-29,6
+28,7
@@
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
+#include "busybox.h"
static const struct suffix_mult tail_suffixes[] = {
{ "b", 512 },
static const struct suffix_mult tail_suffixes[] = {
{ "b", 512 },
@@
-37,12
+37,6
@@
static const struct suffix_mult tail_suffixes[] = {
{ NULL, 0 }
};
{ NULL, 0 }
};
-#ifndef BB_FEATURE_SIMPLE_TAIL
-static const struct suffix_mult null_suffixes[] = {
- { NULL, 0 }
-};
-#endif
-
static const int BYTES = 0;
static const int LINES = 1;
static const int BYTES = 0;
static const int LINES = 1;
@@
-50,14
+44,14
@@
static char *tailbuf;
static int taillen;
static int newline;
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;
}
{
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);
{
char *s;
s = memchr(tailbuf, '\n', taillen);
@@
-96,14
+90,14
@@
int tail_main(int argc, char **argv)
hide_headers = 1;
break;
case 's':
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:
break;
case 'v':
show_headers = 1;
break;
#endif
default:
-
usage(tail_usage
);
+
show_usage(
);
}
}
}
}