]> git.ipfire.org Git - thirdparty/coreutils.git/commit
tail: seek to the end of block devices
authorPádraig Brady <P@draigBrady.com>
Mon, 13 Nov 2017 07:06:08 +0000 (23:06 -0800)
committerPádraig Brady <P@draigBrady.com>
Sun, 19 Nov 2017 06:26:02 +0000 (22:26 -0800)
commit31dd7a0de272affa1120ba1fbc7db3445c548aa5
treea56158347982820234376c812dc8824f97529b67
parent25030d942d41b9afdc66ead2f4ab04d287242445
tail: seek to the end of block devices

* src/tail.c (tail_bytes): Try lseek(..., SEEK_END) when
we can't determine the file size.
* tests/tail-2/end-of-device.sh: Add a new root only test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the improvement.
Paul Eggert suggested using lseek() (rather than ioctl(BLKGETSIZE64)).
Fixes https://bugs.gnu.org/29259
NEWS
src/tail.c
tests/local.mk
tests/tail-2/end-of-device.sh [new file with mode: 0755]