]> Sergey Matveev's repositories - public-inbox.git/commitdiff
li2wrap: avoid double-close on Linux::Inotify2 <2.3
authorEric Wong <e@80x24.org>
Fri, 6 Aug 2021 00:29:52 +0000 (00:29 +0000)
committerEric Wong <e@80x24.org>
Fri, 6 Aug 2021 01:01:46 +0000 (01:01 +0000)
LI2Wrap was not working as expected due to the missing bless
to override ->DESTROY.  This bug showed up in an message check in
t/lei-q-remote-import.t

Fixes: 7fc6e30aeab9925b ("lei: close inotify FD in forked child")
lib/PublicInbox/LI2Wrap.pm

index 61cf4beef081e6d7d4128484e88e0d5a9df6a1c2..204850a60fba54ab06b850619dca73e31b084e4e 100644 (file)
@@ -12,6 +12,7 @@ sub wrapclose {
        my ($inot) = @_;
        my $fd = $inot->fileno;
        open my $fh, '<&=', $fd or die "open <&= $fd $!";
+       bless $inot, __PACKAGE__;
 }
 
 sub DESTROY {} # no-op