On 23/01/2026 18:38, Bruno Haible wrote:
On CentOS 5, I see three test failures:FAIL: tests/tail/overlay-headers FAIL: tests/cp/attr-existing FAIL: tests/mv/part-symlink The first one is new; the other two were already reported in https://lists.gnu.org/archive/html/coreutils/2025-09/msg00135.html
This one is interesting. tests/tail/overlay-headers.sh was made more robust in this release, and now does actually exercise the inotify logic. This test fails because tail(1) exits with: tail: error waiting for inotify and output events: Interrupted system call I.e. the poll(with timeout) is returning with EINTR. I think this is because older kernels bail on the call rather than restarting, due to not adjusting the timeout, whereas newer kernels restart, with an adjusted timeout. The attached retries the poll() with errno==EINTR, which should address the issue. thanks, Padraig
From f78f2f6a9753646aec7e3432d4ab394af9eca9b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= <[email protected]> Date: Sat, 24 Jan 2026 18:04:46 +0000 Subject: [PATCH] tail: fix EINTR handling on older systems tail(1) could fail with an "Interrupted system call" diagnostic, on some systems like Centos 5 (Linux 2.6.18). This was seen with tests/tail/overlay-headers.sh which sends SIGCONT, which should not induce a failure. * src/tail.c (tail_forever_inotify): Retry the poll() upon receiving a non terminating signal, and the syscall is not automatically restarted by the system. * NEWS: Mention the bug fix. Reported by Bruno Haible. --- NEWS | 4 ++++ src/tail.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index c3c985bb3..a19744ddd 100644 --- a/NEWS +++ b/NEWS @@ -31,6 +31,10 @@ GNU coreutils NEWS -*- outline -*- 'numfmt' no longer drops custom suffixes from numbers it cannot fully parse. [bug introduced with numfmt in coreutils-8.21] + 'tail -f --pid' can no longer exit upon receiving a non terminating signal. + On older Linux systems it may have failed with "Interrupted system call". + [bug introduced in coreutils-7.5] + 'timeout' will now propagate all terminating signals to the monitored command. Previously 'timeout' could have exited and left the monitored command running. [bug introduced with timeout in coreutils-7.0] diff --git a/src/tail.c b/src/tail.c index e549f5df0..c0d4e0329 100644 --- a/src/tail.c +++ b/src/tail.c @@ -1684,7 +1684,7 @@ tail_forever_inotify (int wd, struct File_spec *f, int n_files, pfd[1].events = pfd[1].revents = 0; file_change = poll (pfd, monitor_output + 1, delay); } - while (file_change == 0); + while (file_change == 0 || (file_change < 0 && errno == EINTR)); if (file_change < 0) error (EXIT_FAILURE, errno, -- 2.52.0
