[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] tail: fix tailing non seekable files on certain systems
From: |
Pádraig Brady |
Subject: |
[PATCH] tail: fix tailing non seekable files on certain systems |
Date: |
Sat, 9 Dec 2017 20:32:23 -0800 |
* src/tail.c (tail_bytes): On systems were blksize_t is unsigned
and the same size or wider than off_t (android for example),
our initialized (off_t) -1 would be promoted to unsigned before
comparison, and thus fail to follow the appropriate path.
* NEWS: Mention the fix.
This issue was introduced in commit v8.23-47-g2662702
Reported at https://github.com/termux/termux-app/issues/233
---
NEWS | 4 ++++
src/tail.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/NEWS b/NEWS
index 2a2515b..3626c3d 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,10 @@ GNU coreutils NEWS -*-
outline -*-
stty no longer crashes when processing settings with -F also specified.
[bug introduced in fileutils-4.0]
+ tail --bytes again supports non seekable inputs on all systems.
+ On systems like android it always tried to process as seekable inputs.
+ [bug introduced in coreutils-8.24]
+
timeout will again notice its managed command exiting, even when
invoked with blocked CHLD signal, or in a narrow window where
this CHLD signal from the exiting child was missed. In each case
diff --git a/src/tail.c b/src/tail.c
index 536d034..642c448 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -1855,7 +1855,7 @@ tail_bytes (const char *pretty_filename, int fd,
uintmax_t n_bytes,
else if ((current_pos = lseek (fd, -n_bytes, SEEK_END)) != -1)
end_pos = current_pos + n_bytes;
}
- if (end_pos <= ST_BLKSIZE (stats))
+ if (end_pos <= (off_t) ST_BLKSIZE (stats))
return pipe_bytes (pretty_filename, fd, n_bytes, read_pos);
if (current_pos == -1)
current_pos = xlseek (fd, 0, SEEK_CUR, pretty_filename);
--
2.9.3
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] tail: fix tailing non seekable files on certain systems,
Pádraig Brady <=