use Text::ParseWords qw/shellwords/;
use Time::HiRes qw/alarm/;
-my (@fds, $timeout, $mlimit, $olimit, $sudo);
-my $close = 1;
+my (@fds, $timeout, $mlimit, $olimit, $sudo, $keep_stderr);
GetOptions(
- "fd=s" => \@fds,
- "timeout=f" => \$timeout,
- "mlimit=i" => \$mlimit,
- "olimit=i" => \$olimit,
- "close!" => \$close,
- "sudo!" => \$sudo,
+ "fd=s" => \@fds,
+ "timeout=f" => \$timeout,
+ "mlimit=i" => \$mlimit,
+ "olimit=i" => \$olimit,
+ "keep-stderr!" => \$keep_stderr,
+ "sudo!" => \$sudo,
);
my $killuser = $ENV{GRUNTMASTER_KILL_USER};
exit !say AC, "\nAll OK";
} else {
$^F = 50;
- if ($close) {
- POSIX::close $_ for 0 .. $^F;
- }
+ POSIX::close 2 unless $keep_stderr;
+ POSIX::close $_ for 0, 1, 3 .. $^F;
for my $fdstring (@fds) {
my ($fd, $file) = split ' ', $fdstring, 2;
open my $fh, $file or die $!;
get_logger->trace("Running $name...");
my $basename = fileparse $name, qr/[.][^.]*/s;
my @args = ('--sudo');
- push @args, '--no-close' if $ENV{TEST_VERBOSE};
+ push @args, '--keep-stderr' if $ENV{TEST_VERBOSE};
push @args, '--timeout', $args{timeout} if $args{timeout};
push @args, '--mlimit', $args{mlimit} if $args{mlimit};
push @args, '--olimit', $args{olimit} if $args{olimit};