Skip to content

Commit

Permalink
kill: reject undocumented -L (#778)
Browse files Browse the repository at this point in the history
* The pod manual doesn't mention -L
* Follow BSD version and raise an error for -L, which is not standardised [1]
* With this patch kill will exit(1) but it will show signal listing (by default for bad signal spec)

1. https://pubs.opengroup.org/onlinepubs/009696799/utilities/kill.html
  • Loading branch information
mknos authored Nov 1, 2024
1 parent 72f175b commit 1e62033
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/kill
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ my @signals = getsigs();
my %hsignals = map { $_ => 1 } @signals;
my $signal = 'TERM';

if ( $ARGV[0] =~ /^-l$/i ) { # list signals
if ($ARGV[0] eq '-l') { # list signals
siglist();
exit 0;
}
Expand Down Expand Up @@ -73,7 +73,7 @@ sub usage {
}

sub siglist {
for(my($i)=1;$i<=$#signals;$i++){
foreach my $i (1 .. $#signals) {
printf "%2d:%-6s%s",$i,$signals[$i],
( ($i % 8 == 0) || ($i == $#signals) )?"\n":" ";
}
Expand Down

0 comments on commit 1e62033

Please sign in to comment.