develooper Front page | perl.perl5.porters | Postings from December 2001

[PATCH] check return of close

From:
andreas.koenig
Date:
December 27, 2001 00:53
Subject:
[PATCH] check return of close
Message ID:
m3ellhgicd.fsf@anima.de
Another one...

--- /usr/sources/perl/repoperls/perl-5.7.2@13899/t/io/fflush.t	Mon Jul  9 16:11:22 2001
+++ perl-5.7.2@13899/t/io/fflush.t	Thu Dec 27 09:45:03 2001
@@ -66,7 +66,7 @@
 close OUT;
 EOF
     ;
-close PROG;
+close PROG or die "close ff-prog: $!";;
 push @delete, "ff-prog";
 
 $| = 0; # we want buffered output
@@ -122,7 +122,7 @@
     my $command = qq{$runperl "ff-prog" "$f" "rl"};
     open OUT, "> $f" or die "open $f: $!";
     print OUT "Pe";
-    close OUT;
+    close OUT or die "close $f: $!";;
     print "# $command\n";
     $code->($command);
     print file_eq($f, "Perl") ? "ok $t\n" : "not ok $t\n";

-- 
andreas



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About