You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-dev@httpd.apache.org by Stas Bekman <st...@stason.org> on 2002/01/16 09:25:05 UTC

[patch] preserving the ARGV intact for ulimit restart

currently this doesn't work:

   t/TEST -preamble "PerlTrace all"

since when ulimit restarts, it executes:

t/TEST -preamble PerlTrace all

"@ARGV" stringification looses the "/' delimitors.

this patch attempts to fix this bug.

Index: Apache-Test/lib/Apache/TestRun.pm
===================================================================
RCS file: 
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRun.pm,v
retrieving revision 1.84
diff -u -r1.84 TestRun.pm
--- Apache-Test/lib/Apache/TestRun.pm	10 Jan 2002 05:34:08 -0000	1.84
+++ Apache-Test/lib/Apache/TestRun.pm	16 Jan 2002 08:19:04 -0000
@@ -500,7 +500,9 @@
      }
      close $sh;

-    my $command = "ulimit -c unlimited; $0 @ARGV";
+    # reconstruct argv, preserve multiwords args, eg 'PerlTrace all'
+    my $argv = join " ", map {/^-/ ? $_ : qq['$_']} @ARGV;
+    my $command = "ulimit -c unlimited; $0 $argv";
      warning "setting ulimit to allow core files\n$command";
      exec $command;
      die "exec $command has failed"; # shouldn't be reached


_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/