diff options
author | Pádraig Brady <P@draigBrady.com> | 2023-01-30 21:44:10 +0000 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2023-02-06 16:18:12 +0000 |
commit | c0c63e9735908a9579f8735001957db6bd81afc3 (patch) | |
tree | 8e526079d53dd9f98965dc0e3a2fef26ea954811 /src | |
parent | ead07bb3d461389bb52336109be7858458e49c38 (diff) | |
download | coreutils-c0c63e9735908a9579f8735001957db6bd81afc3.tar.gz |
tail: fix support for -F with non seekable files
This was seen to be an issue when following a
symlink that was being updated to point to
different underlying devices.
* src/tail.c (recheck): Guard the lseek() call to only
be performed for regular files.
* NEWS: Mention the bug fix.
Diffstat (limited to 'src')
-rw-r--r-- | src/tail.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tail.c b/src/tail.c index 2244509dd..03061e8bf 100644 --- a/src/tail.c +++ b/src/tail.c @@ -1122,7 +1122,8 @@ recheck (struct File_spec *f, bool blocking) { /* Start at the beginning of the file. */ record_open_fd (f, fd, 0, &new_stats, (is_stdin ? -1 : blocking)); - xlseek (fd, 0, SEEK_SET, pretty_name (f)); + if (S_ISREG (new_stats.st_mode)) + xlseek (fd, 0, SEEK_SET, pretty_name (f)); } } |