X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Fbin%2Fbomb.pl;h=9e0f06bde88b09645fc2d39bfc8e046055a314c4;hb=0360c45d9be87b9a5de497933fb316752868bab9;hp=6211eab85b49ac4067eeac8dfdc84f6b2ae76b29;hpb=a353544f60e704aca2e4bb68ae8a59e16e7a8624;p=mkws-moved-to-github.git diff --git a/test/bin/bomb.pl b/test/bin/bomb.pl index 6211eab..9e0f06b 100755 --- a/test/bin/bomb.pl +++ b/test/bin/bomb.pl @@ -6,6 +6,7 @@ use Getopt::Long; use POSIX ":sys_wait_h"; +use BSD::Resource qw/setrlimit/; use strict; use warnings; @@ -38,6 +39,10 @@ my @system = @ARGV; die usage if $help; die usage if !@system; +# set CPU limit, in case the alarm handler will +# be ignored +setrlimit("RLIMIT_CPU", $timeout, 2*$timeout) or die "Cannot set CPU limit: $!\n"; + # # use fork/exec instead system() # @@ -54,4 +59,3 @@ if ($pid) { else { } 1; -