From: Vincent Pit Date: Sun, 28 Sep 2008 11:56:47 +0000 (+0200) Subject: Use indirect exec syntax X-Git-Tag: v0.07~6 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=66686a5cd7b12c4d529afd82273bd81cacf1ee6d;p=perl%2Fmodules%2FTest-Valgrind.git Use indirect exec syntax --- diff --git a/lib/Test/Valgrind.pm b/lib/Test/Valgrind.pm index 4c87dec..b403e0f 100644 --- a/lib/Test/Valgrind.pm +++ b/lib/Test/Valgrind.pm @@ -163,6 +163,7 @@ sub import { close $vrdr or die "close(\$vrdr): $!"; fcntl $vwtr, F_SETFD, 0 or die "fcntl(\$vwtr, F_SETFD, 0): $!"; my @args = ( + $vg, '--tool=memcheck', '--leak-check=full', '--leak-resolution=high', @@ -184,7 +185,8 @@ sub import { print STDOUT "valgrind @args\n"; local $ENV{PERL_DESTRUCT_LEVEL} = 3; local $ENV{PERL_DL_NONLAZY} = 1; - exec $vg, @args; + exec { $args[0] } @args; + die "exec @args: $!"; } local $SIG{INT} = sub { kill -(SIGTERM) => $pid }; $Test->plan(tests => 5) unless $args{no_test} or defined $Test->has_plan;