X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=blobdiff_plain;f=test%2Fbin%2Fbomb.pl;h=2dde3d48f37ec1012e98d627f01f2c1db5da628f;hp=1592161c9eed56ffa855242dbbbaf7b34d4c802a;hb=e037fab727a9eb80c33f1693fcd6d0b67b84da32;hpb=bc574e44244a984d51bf5aa9de3df27d1f277777 diff --git a/test/bin/bomb.pl b/test/bin/bomb.pl index 1592161..2dde3d4 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,7 +58,8 @@ $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; @@ -69,7 +71,6 @@ $SIG{INT} = "IGNORE"; alarm($timeout); system(@system) == 0 - or die "system @system failed: $?"; + or die "system('@system') failed: ?='$?', !='$!'\n"; 1; -