X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;ds=sidebyside;f=test%2Fbin%2Fbomb.pl;h=b993c7a4bf986acbbbe9b7e193cb0e55dbe51ffd;hb=HEAD;hp=1592161c9eed56ffa855242dbbbaf7b34d4c802a;hpb=bc574e44244a984d51bf5aa9de3df27d1f277777;p=mkws-moved-to-github.git diff --git a/test/bin/bomb.pl b/test/bin/bomb.pl index 1592161..b993c7a 100755 --- a/test/bin/bomb.pl +++ b/test/bin/bomb.pl @@ -38,17 +38,18 @@ my @system = @ARGV; die usage if $help; die usage if !@system; -# set CPU limit, in case the alarm handler will -# be ignored -eval { - require BSD::Resource; - BSD::Resource::setrlimit( "RLIMIT_CPU", $timeout, 2 * $timeout ) - or die "Cannot set CPU limit: $!\n"; -}; -if ($@) { - warn - "WARNING: things would go more nicely with the BSD::Resource package\n"; -} +# disabled - we set the CPU limit in the wrapper ./bomb +## set CPU limit, in case the alarm handler will +## be ignored +#eval { +# require BSD::Resource; +# BSD::Resource::setrlimit( "RLIMIT_CPU", $timeout, 2 * $timeout ) +# or die "Cannot set CPU limit: $!\n"; +#}; +#if ($@) { +# warn +# "WARNING: things would go more nicely with the BSD::Resource package\n"; +#} # # configure signal handlers @@ -57,10 +58,11 @@ $SIG{ALRM} = sub { my $pgid = getpgrp(); warn "Alarm handler got called after $timeout seconds\n"; - warn "Kill now the process group...\n\n"; + warn "Kill now the process group $pgid\n\n"; + warn "Command: @system\n"; # kill process group - kill "INT", -$pgid; + kill "TERM", -$pgid; }; # don't kill ourself @@ -69,7 +71,6 @@ $SIG{INT} = "IGNORE"; alarm($timeout); system(@system) == 0 - or die "system @system failed: $?"; + or die "system('@system') failed: ?='$?', !='$!'\n"; 1; -