From 5d3e9705c8d5a6d0341a5f1bed2027ef9f9e95a8 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 6 Aug 2021 00:29:52 +0000 Subject: [PATCH] li2wrap: avoid double-close on Linux::Inotify2 <2.3 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/PublicInbox/LI2Wrap.pm b/lib/PublicInbox/LI2Wrap.pm index 61cf4bee..204850a6 100644 --- a/lib/PublicInbox/LI2Wrap.pm +++ b/lib/PublicInbox/LI2Wrap.pm @@ -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 -- 2.48.1