Add a --no-close argument to gruntmaster-exec
authorMarius Gavrilescu <marius@ieval.ro>
Fri, 23 Jan 2015 15:22:12 +0000 (17:22 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Fri, 23 Jan 2015 15:22:12 +0000 (17:22 +0200)
gruntmaster-exec

index a4ae94d4ce0335575dd4dcfa50b7a208078a1a69..dec8be38835c02ed0913078584cce3c1aee16b03 100755 (executable)
@@ -28,11 +28,14 @@ use POSIX qw//;
 use Time::HiRes qw/alarm/;
 
 my (@fds, $timeout, $mlimit, $olimit);
+my $close = 1;
+
 GetOptions(
        "fd=s"      => \@fds,
        "timeout=f" => \$timeout,
        "mlimit=i"  => \$mlimit,
        "olimit=i"  => \$olimit,
+       "close!"    => \$close,
 );
 
 my $ret = fork // die 'Cannot fork';
@@ -51,7 +54,9 @@ if ($ret) {
        exit !say AC,   "\nAll OK";
 } else {
        $^F = 50;
-       POSIX::close $_ for 0 .. $^F;
+       if ($close) {
+               POSIX::close $_ for 0 .. $^F;
+       }
        for my $fdstring (@fds) {
                my ($fd, $file) = split ' ', $fdstring, 2;
                open my $fh, $file or die $!;
This page took 0.011017 seconds and 4 git commands to generate.