From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id DB0731F4D7 for ; Sat, 14 Dec 2024 14:58:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1734188285; bh=Q5X5eFZEsDJOJPUPQTEGKuT/+mL3qz/FF90pcY0HioY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=F5/QG9dhEcnn4Pz/WzFXDyHttgEOB+23m+VmQ5TEDOmF2JFq724ynf4OG16Ihte6L Hw172N2NgeOQ1Du1G13/i5wM80bO/p/v7fIm/fbvsjfIPZfsMBbdEm9tYndT3woBVy KCTcNNTZGxy476uQ3QL1u7JssfAIFBXooIlnCtj4= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 3/3] lei: use PublicInbox::Eml::warn_ignore_cb Date: Sat, 14 Dec 2024 14:58:04 +0000 Message-ID: <20241214145805.755893-4-e@80x24.org> In-Reply-To: <20241214145805.755893-1-e@80x24.org> References: <20241214145805.755893-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: The open-coded callback was identical to the existing callback generated by our Eml package, so just use the existing code instead unless a user uses `lei import --noisy' --- lib/PublicInbox/LEI.pm | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index 34ef95a1..1e8dc17f 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -625,12 +625,8 @@ sub _lei_atfork_child { eval 'no warnings; undef $PublicInbox::LeiNoteEvent::to_flush'; undef $errors_log; $quit = \&CORE::exit; - if (!$self->{opt}->{noisy}) { # only "lei import" sets this atm - my $cb = $SIG{__WARN__} // \&CORE::warn; - $SIG{__WARN__} = sub { - $cb->(@_) unless PublicInbox::Eml::warn_ignore(@_) - }; - } + $self->{opt}->{noisy} or # only "lei import" sets this atm + $SIG{__WARN__} = PublicInbox::Eml::warn_ignore_cb(); $SIG{TERM} = $term_handler; $current_lei = $persist ? undef : $self; # for SIG{__WARN__} }