X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Fbin%2Fbomb.pl;h=9e0f06bde88b09645fc2d39bfc8e046055a314c4;hb=0360c45d9be87b9a5de497933fb316752868bab9;hp=f4b4cec28a1b66b298f89ce1ba4dec1d6e61be82;hpb=6e888e413ec6754c540988844dd5fdfde39f61c0;p=mkws-moved-to-github.git diff --git a/test/bin/bomb.pl b/test/bin/bomb.pl index f4b4cec..9e0f06b 100755 --- a/test/bin/bomb.pl +++ b/test/bin/bomb.pl @@ -5,6 +5,8 @@ # use Getopt::Long; +use POSIX ":sys_wait_h"; +use BSD::Resource qw/setrlimit/; use strict; use warnings; @@ -12,39 +14,11 @@ use warnings; my $debug = 0; my $help; my $timeout = 100; +my $pid; binmode \*STDOUT, ":utf8"; binmode \*STDERR, ":utf8"; -# timeout handler -sub set_alarm { - my $time = shift; - my $message = shift || ""; - - $time = 100 if !defined $time; - - $SIG{ALRM} = sub { - - warn "Time out alarm $time\n"; - - # sends a hang-up signal to all processes in the current process group - # and kill running java processes - local $SIG{HUP} = "IGNORE"; - kill 1, -$$; - - local $SIG{TERM} = "IGNORE"; - kill 15, -$$; - kill 15, -$$; - - warn "Send a hang-up to all childs.\n"; - - #exit 1; - }; - - warn "set alarm time to: $time seconds $message\n" if $debug >= 1; - alarm($time); -} - sub usage () { <