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
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
* 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