]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
tail_notify: reinstate watch on reopen
authorEric Wong <e@80x24.org>
Thu, 7 Sep 2023 00:54:06 +0000 (00:54 +0000)
committerEric Wong <e@80x24.org>
Thu, 7 Sep 2023 05:42:35 +0000 (05:42 +0000)
This fixes t/tail_notify.t on NetBSD 9.3 where the log file
is deleted and later recreated.

lib/PublicInbox/TailNotify.pm

index cbbc1041d3326964d324f64d49254a48efa50ad8..f4ffb29643e6f66c138d90cb480783f88f9e5ab2 100644 (file)
@@ -29,6 +29,7 @@ sub reopen_file ($) {
        open my $fh, '<', $self->{fn} or return undef;
        my @st = stat $fh or die "fstat($self->{fn}): $!";
        $self->{ino_dev} = "@st[0, 1]";
+       $self->{inot}->watch($self->{fn}, $TAIL_MOD);
        $self->{watch_fh} = $fh; # return value
 }