From: Eric Wong Date: Sat, 14 Dec 2024 14:58:04 +0000 (+0000) Subject: lei: use PublicInbox::Eml::warn_ignore_cb X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0dc96332be09ae8776963a76bf02315ca2df325;p=thirdparty%2Fpublic-inbox.git lei: use PublicInbox::Eml::warn_ignore_cb 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' --- diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index 34ef95a15..1e8dc17f0 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__} }