From fee08385a219b309cf51a7679077e3e9a9a5b906 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 3 Jun 2019 18:37:27 -0500 Subject: Remove TAIL_SEEK config option, just always include it. Yeah, it's twice the size and two codepaths, but seekable is the common case, it won't work in pipelines without a non-seek codepath, and the performance penalty not using seek on large files is a enormous. --- toys/posix/tail.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/toys/posix/tail.c b/toys/posix/tail.c index d49a70c2..d7161249 100644 --- a/toys/posix/tail.c +++ b/toys/posix/tail.c @@ -20,13 +20,6 @@ config TAIL -n Output the last NUMBER lines (default 10), +X counts from start -c Output the last NUMBER bytes, +NUMBER counts from start -f Follow FILE(s), waiting for more data to be appended - -config TAIL_SEEK - bool "tail seek support" - default y - depends on TAIL - help - This version uses lseek, which is faster on large files. */ #define FOR_tail @@ -154,7 +147,7 @@ static void do_tail(int fd, char *name) // The slow codepath is always needed, and can handle all input, // so make lseek support optional. - if (CFG_TAIL_SEEK && try_lseek(fd, bytes, lines)) return; + if (try_lseek(fd, bytes, lines)) return; // Read data until we run out, keep a trailing buffer for (;;) { -- cgit v1.2.3