I've tried to find out how to send a PR. So it seems that the easiest way is to send a patch by email. So here is it in the attachment.
Thanks! Best regards, Grigorii ---------- Forwarded message --------- From: Pádraig Brady <p...@draigbrady.com> Date: Thu, 15 Oct 2020 at 15:54 Subject: Re: Coreutils tail.c fixes To: Grigoriy Sokolik <g.soko...@g-sokol.info> On 15/10/2020 12:06, Grigoriy Sokolik wrote: > Sorry for annoying you. > I made some test and not sure what else could be done: > > ### Terminal 1 | ### Terminal 2 > $ mkdir foo_a foo_b | > $ echo 'foo_a' > foo_a/test | > $ echo 'foo_b' > foo_b/test | > $ tail --follow=name foo_a/test foo_b/test | > ==> foo_a/test <== | > foo_a | > | > ==> foo_b/test <== | > foo_b | > | > | # Checking it actually works: > | $ echo 'foo_a_new' >> foo_a/test > ==> foo_a/test <== | > foo_a_new | > | $ mkdir foo_c > | $ echo 'foo_c' > foo_c/test > | rm -rf foo_a > tail: foo_a/test: No such file or directory | > tail: directory containing watched file was removed | > tail: inotify cannot be used, reverting to polling | > | mv foo_c foo_a > tail: 'foo_a/test' has appeared; following new file | > | > ==> foo_a/test <== | > foo_c | > | > > So, I mean, currently, that's already handling the file appeared again. The FIXME comment was added in: https://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=v8.5-191-g61b77891c while the fix (albeit not using inotify) was added in: https://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=v8.27-21-gba5fe2d4b So we should remove that FIXME comment now. cheers, Pádraig
From 693fff73b482b79c7a2944d368a6d5ca87caff62 Mon Sep 17 00:00:00 2001 From: Grigorii Sokolik <g.soko...@g-sokol.info> Date: Thu, 15 Oct 2020 16:56:25 +0300 Subject: [PATCH] tail: README-prereq fix and remove unactual fixme in tail.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As Pádraig Brady wrote me: > The FIXME comment was added in: > https://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=v8.5-19 1-g61b77891c > > while the fix (albeit not using inotify) was added in: > https://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=v8.27-2 1-gba5fe2d4b > > So we should remove that FIXME comment now. And also there are some small changes in README-prereq to make it work properly. --- README-prereq | 3 ++- src/tail.c | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/README-prereq b/README-prereq index fdf89fecd..16684a8b8 100644 --- a/README-prereq +++ b/README-prereq @@ -34,6 +34,7 @@ set correctly by running this command: # Please use the latest stable release version as indicated by git tags. git clone --depth=1 git://git.sv.gnu.org/autoconf.git cd autoconf + git pull --tags git checkout v2.64 autoreconf -vi ./configure --prefix=$prefix @@ -55,7 +56,7 @@ requires version 1.10a or newer, as well as the xz program itself. * xz * - git clone git://ctrl.tukaani.org/xz.git + git clone https://git.tukaani.org/xz.git cd xz ./autogen.sh ./configure --prefix=$prefix diff --git a/src/tail.c b/src/tail.c index 1c8872396..18e52b1bf 100644 --- a/src/tail.c +++ b/src/tail.c @@ -2479,10 +2479,6 @@ main (int argc, char **argv) recheck it and follow the new file, or ignore it if the file has changed to being remote. - FIXME: when using inotify, and a directory for a watched file - is recreated, then we don't recheck any new file when - follow_mode == Follow_name. - FIXME-maybe: inotify has a watch descriptor per inode, and hence with our current hash implementation will only --follow data for one of the names when multiple hardlinked files are specified, or -- 2.28.0