bug#67490: [PATCH] tail: fix following /proc and /sys files when using a 64K page size

2023-11-27 Thread Paul Eggert
On 2023-11-27 08:24, dann frazier wrote: + if (fstat (fd, ) != 0) +{ + error (0, errno, _("cannot fstat %s"), quoteaf (pretty_filename)); + return false; +} + + bufsize = ST_BLKSIZE (stats); If fstat fails, that's no reason to exit. Just use bufsize = BUFSIZ and keep

bug#67490: [PATCH] tail: fix following /proc and /sys files when using a 64K page size

2023-11-27 Thread Pádraig Brady
On 27/11/2023 16:24, dann frazier wrote: * src/tail.c (file_lines): Use fstat() to determine a file's block size and dynamically allocate a buffer of that size for traversing backwards. Thanks for the patch. Could you describe it a bit more. What happens if we use smaller reads? Also what

bug#67490: [PATCH] tail: fix following /proc and /sys files when using a 64K page size

2023-11-27 Thread dann frazier
* src/tail.c (file_lines): Use fstat() to determine a file's block size and dynamically allocate a buffer of that size for traversing backwards. --- src/tail.c | 36 ++-- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/src/tail.c b/src/tail.c index