Files
coreutils/src
Paul Eggert 976f8abc19 tail: record file offset more carefully
* src/tail.c (struct File_spec): New member read_pos, replacing
size, since the value was really a read position not a size.
All uses changed.
(xlseek): Move defn up.
(record_open_fd): If the read_pos (formerly) size arg is unknown,
compute it here if it is a regular file.
(file_lines): Return the resulting read pos (or -1 on failure)
instead of storing it via a pointer.  Caller changed.
Simplify by using SEEK_CUR instead of SEEK_SET when that is easy.
Avoid reading the same data twice when there are not enough
lines in the file.
(pipe_lines): Return -2 on success, -1 on failure, rather than
updating a read pos via a pointer (which was weird for pipes anyway).
Caller changed.
(pipe_bytes, tail_bytes, tail_lines, tail):
Return -1 on failure, a file offset if known, and < -1 otherwise,
instead of storing a file offset via a pointer.  Caller changed.
(pipe_bytes): Take initial file offset as an arg, or -1 if unknown.
(start_bytes, start_lines): Return -1 (not 1) on error, -2 (not
-1) on EOF, and do not accept pointer to read pos as an arg since
neither we nor our caller know the read pos.  Callers changed.
(recheck): Do not assume a newly-opened file is at offset zero,
as this is not always true on Solaris.
(tail_forever, check_fspec): Use dump_remainder result only
on regular files, to prevent (very unlikely) overflow.
(tail_file): Remove no-longer-needed TAIL_TEST_SLEEP code.
2025-08-03 19:48:06 -07:00
..
2025-08-03 19:48:05 -07:00
2025-02-02 22:09:52 -08:00
2025-02-20 12:56:20 +00:00
2023-12-27 19:51:00 +00:00
2025-02-18 20:10:19 -08:00
2025-02-18 20:10:19 -08:00
2025-02-18 20:10:19 -08:00
2025-02-18 20:10:19 -08:00
2025-05-01 14:05:59 +01:00
2025-02-20 12:56:20 +00:00
2025-02-20 12:56:20 +00:00
2025-07-29 11:43:09 +01:00
2005-07-18 07:52:37 +00:00
2025-02-20 12:56:20 +00:00
2025-02-20 12:56:20 +00:00
2025-08-03 19:48:05 -07:00
2025-02-20 12:56:20 +00:00
2025-05-28 12:49:17 -07:00
2025-07-31 17:57:59 -07:00
2025-05-12 01:28:48 -07:00
…
…
…
2025-07-29 11:43:09 +01:00
2025-08-03 19:48:04 -07:00
2025-02-20 12:56:20 +00:00
2025-07-09 17:12:40 -07:00
2025-06-23 13:16:32 +01:00
2025-02-02 22:09:52 -08:00
2025-08-03 19:48:05 -07:00
2025-08-03 19:48:06 -07:00
2025-08-03 19:48:05 -07:00
2025-06-21 10:59:46 +01:00
2007-07-10 19:00:00 +02:00
2007-07-10 19:00:00 +02:00
2025-02-20 12:56:20 +00:00
2023-09-23 17:07:52 -07:00