about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-10-01 09:54:28 +0000
committerEric Wong <e@80x24.org>2023-10-01 22:41:49 +0000
commit2ab8795b86d0878d3f0d0830d2c178d292766e70 (patch)
tree059c7bacca55763b5125692fc5e0b091c8151893
parentb231d91f42d791becf7b6861e723833d71e73237 (diff)
downloadpublic-inbox-2ab8795b86d0878d3f0d0830d2c178d292766e70.tar.gz
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.
-rw-r--r--lib/PublicInbox/LEI.pm2
1 files changed, 1 insertions, 1 deletions
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) {