This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In t/op/getppid.t, die if any pipe close fails.
authorNicholas Clark <nick@ccl4.org>
Fri, 1 Jun 2012 13:32:47 +0000 (15:32 +0200)
committerNicholas Clark <nick@ccl4.org>
Sat, 2 Jun 2012 10:39:13 +0000 (12:39 +0200)
It shouldn't happen, but the diagnostics will be useful if does.

t/op/getppid.t

index a631610..cad0078 100644 (file)
@@ -27,7 +27,7 @@ sub fork_and_retrieve {
 
     if ($pid) {
        # parent
-       close $w;
+       close $w or die "close: $!\n";
        $_ = <$r>;
        chomp;
        die "Garbled output '$_'"
@@ -46,11 +46,11 @@ sub fork_and_retrieve {
        # child
        # Prevent test.pl from thinking that we failed to run any tests.
        $::NO_ENDING = 1;
-       close $r;
+       close $r or die "close: $!\n";
 
        my $pid2 = fork; defined $pid2 or die "fork: $!\n";
        if ($pid2) {
-           close $w;
+           close $w or die "close: $!\n";
            sleep 1;
        }
        else {