mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
tail: simplify -c+ on regular files
* src/tail.c (tail_bytes): Simplify the -c+N case by treating regular files like other files; if the lseek fails for whatever reason, fall back on the unoptimized version instead of reporting a fatal error.
This commit is contained in:
1 parent
938035b9b4
commit
c667ca229f
1 file changed
+1
-3
+1
-3
@@ -1858,9 +1858,7 @@ tail_bytes (char const *pretty_filename, int fd, uintmax_t n_bytes,
|
||||
if (from_start)
|
||||
{
|
||||
if (! presume_input_pipe && n_bytes <= OFF_T_MAX
|
||||
&& ((S_ISREG (stats.st_mode)
|
||||
&& xlseek (fd, n_bytes, SEEK_CUR, pretty_filename) >= 0)
|
||||
|| lseek (fd, n_bytes, SEEK_CUR) != -1))
|
||||
&& 0 <= lseek (fd, n_bytes, SEEK_CUR))
|
||||
*read_pos += n_bytes;
|
||||
else
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user