summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tail.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tail.c b/src/tail.c
index ca851ee6f..cdaecddc4 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -2149,6 +2149,10 @@ main (int argc, char **argv)
" indefinitely is ineffective"));
}
+ /* Don't read anything if we'll never output anything. */
+ if (! n_units && ! forever && ! from_start)
+ exit (EXIT_SUCCESS);
+
F = xnmalloc (n_files, sizeof *F);
for (i = 0; i < n_files; i++)
F[i].name = file[i];