From 4d45722d1160a04e4d26fd812da4e0140ad3550c Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Wed, 9 Nov 2016 19:28:23 +0000 Subject: tail: only retry file open if --retry specifed * src/tail.c (tail_file): On failure to open a file, set ignore=true when --retry is not specified. * tests/tail-2/assert-2.sh: Adjust to the new behavior. * tests/tail-2/retry.sh: Add a test case. Also change from `tail ... && fail=1` to the more robust `returns_ 1 ...` construct which detects segfaults etc. * NEWS: Document the fix. --- src/tail.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/tail.c') diff --git a/src/tail.c b/src/tail.c index 66aad5b78..193e4fd7d 100644 --- a/src/tail.c +++ b/src/tail.c @@ -1909,7 +1909,7 @@ tail_file (struct File_spec *f, uintmax_t n_units) { f->fd = -1; f->errnum = errno; - f->ignore = false; + f->ignore = ! reopen_inaccessible_files; f->ino = 0; f->dev = 0; } -- cgit v1.2.3-54-g00ecf