From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id E70721F8C6 for ; Fri, 6 Aug 2021 00:29:52 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] li2wrap: avoid double-close on Linux::Inotify2 <2.3 Date: Fri, 6 Aug 2021 00:29:52 +0000 Message-Id: <20210806002952.22924-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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