From: Eric Wong Date: Sun, 1 Oct 2023 09:54:28 +0000 (+0000) Subject: lei: ->fail only allows integer exit codes X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2ab8795b86d0878d3f0d0830d2c178d292766e70;p=thirdparty%2Fpublic-inbox.git lei: ->fail only allows integer exit codes We can't use floating point numbers nor Inf/-Inf as exit codes; but we can allow `-1' as shorthand for 255. --- diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index 1b14d5e12..1899bf38c 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -524,7 +524,7 @@ sub sigpipe_handler { # handles SIGPIPE from @WQ_KEYS workers sub fail ($;@) { my ($lei, @msg) = @_; - my $exit_code = looks_like_number($msg[0]) ? shift(@msg) : undef; + my $exit_code = ($msg[0]//'') =~ /\A-?[0-9]+\z/ ? shift(@msg) : undef; local $current_lei = $lei; $lei->{failed}++; if (@msg) {