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,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 BF7281F56F for ; Sun, 1 Oct 2023 09:54:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1696154071; bh=L/kceRkfhztBv09TF0wijLh/4P/lcdY2okXrMVXKnjY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ysykOkxJBR/o2RXmwQELLnBJxpZolN0wGkq5hL6fJc00KymNtIw9gcKLrvkD+3uq2 79DlcR6vi31P/jISp3OxjuEWrG7tHkM3qF1+ixeFswDMSQC1zbQuwTwjL3O6OgXkMY 2hlfRwPT+zKiEFxLevGPIbQVrXHNyYjlnclY4rnI= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 12/13] lei: ->fail only allows integer exit codes Date: Sun, 1 Oct 2023 09:54:28 +0000 Message-ID: <20231001095429.2092610-13-e@80x24.org> In-Reply-To: <20231001095429.2092610-1-e@80x24.org> References: <20231001095429.2092610-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We can't use floating point numbers nor Inf/-Inf as exit codes; but we can allow `-1' as shorthand for 255. --- lib/PublicInbox/LEI.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index 1b14d5e1..1899bf38 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) {