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-07-04 20:52:37 -07:00
2025-06-18 14:20:17 +01:00
2025-01-01 09:33:08 +00:00
2025-05-09 15:57:13 -07:00
2025-08-03 19:48:05 -07:00
2025-01-01 09:33:08 +00:00
2025-02-02 22:09:52 -08:00
2023-12-27 19:51:00 +00:00
2023-12-27 19:51:00 +00:00
2025-02-20 12:56:20 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2023-12-27 19:51:00 +00:00
2025-06-03 23:11:44 +01: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-18 09:49:29 +01:00
2025-02-20 12:56:16 +00:00
2025-06-22 11:33:11 +01:00
2025-05-01 14:05:59 +01:00
2025-01-07 17:28:49 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-02-20 12:56:20 +00:00
2022-01-31 12:07:39 -08:00
2025-06-07 18:53:43 +01:00
2025-02-20 12:56:20 +00:00
2025-01-01 09:33:08 +00:00
2025-08-01 13:31:28 +01:00
2025-01-01 09:33:08 +00:00
2025-07-29 11:43:09 +01:00
2025-06-25 09:08:35 +01:00
2025-05-09 15:57:13 -07:00
2025-01-01 09:33:08 +00:00
2025-03-15 12:57:53 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-07-29 11:43:09 +01:00
2025-01-01 09:33:08 +00:00
2025-07-29 11:43:09 +01:00
2025-04-04 21:14:29 +01:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-07-27 07:30:49 -07:00
2005-07-18 07:52:37 +00:00
2025-02-20 12:56:20 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-02-20 12:56:20 +00:00
2021-10-31 22:36:46 -07:00
2025-01-01 09:33:08 +00:00
2025-02-20 12:56:20 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-08-03 19:48:05 -07:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-03-22 12:35:15 +00:00
2025-01-07 17:28:49 +00:00
2025-08-03 19:48:05 -07:00
2025-02-20 12:56:20 +00:00
2023-03-13 21:26:21 +00:00
2025-06-22 11:33:11 +01:00
2025-01-01 09:33:08 +00:00
2025-05-24 13:02:31 -07:00
2025-01-01 09:33:08 +00:00
2025-05-28 12:49:17 -07:00
2025-07-31 17:57:59 -07:00
2025-01-01 09:33:08 +00:00
2025-05-12 01:28:48 -07:00
2025-07-29 11:43:09 +01:00
2012-01-09 21:51:59 +01:00
2025-07-09 17:12:40 -07:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-07 17:28:49 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2024-05-05 17:50:28 +01:00
2025-08-03 19:48:04 -07:00
2025-02-20 12:56:20 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-06-03 23:11:44 +01:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-06-22 11:33:11 +01:00
2025-01-01 09:33:08 +00:00
2025-08-03 12:33:55 -07:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-05-12 01:28:48 -07:00
2025-01-01 09:33:08 +00:00
2025-06-22 11:33:11 +01:00
2025-01-01 09:33:08 +00:00
2025-02-20 12:56:20 +00:00
2024-05-05 17:50:14 +01:00
2025-06-25 09:08:35 +01:00
2025-01-01 09:33:08 +00:00
2025-04-07 00:59:27 -07:00
2025-07-29 11:43:09 +01:00
2025-07-09 17:12:40 -07:00
2025-07-29 11:43:09 +01:00
2025-05-09 15:57:13 -07:00
2025-01-01 09:33:08 +00:00
2025-06-23 13:16:32 +01:00
2025-07-29 11:43:09 +01:00
2025-05-09 15:57:13 -07:00
2023-02-06 13:09:40 +00:00
2025-02-02 22:09:52 -08:00
2025-07-29 11:43:09 +01:00
2025-01-01 09:33:08 +00:00
2025-08-03 19:48:05 -07:00
2025-08-03 19:48:06 -07:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2023-07-18 23:10:40 +01:00
2025-06-18 14:20:17 +01:00
2025-07-26 00:17:16 -07:00
2025-07-29 11:43:09 +01:00
2025-01-01 09:33:08 +00:00
2025-08-03 19:48:05 -07:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00: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-01-01 09:33:08 +00:00
2012-01-09 21:51:59 +01:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-02-20 12:56:20 +00:00
2025-08-03 19:48:04 -07:00
2023-09-23 17:07:52 -07:00
2025-07-29 11:43:09 +01:00
2025-01-01 09:33:08 +00:00
2025-01-15 22:16:30 +00:00