From: Mark-Jason Dominus Date: Wed, 17 Apr 2002 11:14:17 +0000 (-0400) Subject: Re: [ID 20020416.001] 'close' does not report failure when buffer flush fails X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=abb5764d7f2ed248968de325e6b292c8d425db71;p=p5sagit%2Fp5-mst-13.2.git Re: [ID 20020416.001] 'close' does not report failure when buffer flush fails Message-ID: <20020417151417.27268.qmail@plover.com> p4raw-id: //depot/perl@15981 --- diff --git a/t/io/full.t b/t/io/full.t index 917050f..f1b31ff 100644 --- a/t/io/full.t +++ b/t/io/full.t @@ -4,7 +4,7 @@ # 20020416 mjd-perl-patch+@plover.com unless (-c "/dev/full" && open FULL, "> /dev/full") { - print "1..0\n"; exit 0; + print "1..0\n"; exit; } my $z; @@ -16,17 +16,17 @@ $z = close(FULL); print $z ? "not ok 2 # z=$z; $!\n" : "ok 2\n"; print $!{ENOSPC} ? "ok 3\n" : "not ok 3\n"; -unless (open FULL, "> /dev/full") { +if (open FULL, "> /dev/full") { + select FULL; $| = 1; select STDOUT; + + # Should fail + $z = print FULL "I like pie.\n"; + print $z ? "not ok 4 # z=$z; $!\n" : "ok 4\n"; + print $!{ENOSPC} ? "ok 5\n" : "not ok 5\n"; + $z = close FULL; + print $z ? "ok 6\n" : "not ok 6 # z=$s; $!\n"; +} else { print "# couldn't open /dev/full the second time: $!\n"; print "not ok $_\n" for 4..6; - exit 0; } -select FULL; $| = 1; select STDOUT; - -# Should fail -$z = print FULL "I like pie.\n"; -print $z ? "not ok 4 # z=$z; $!\n" : "ok 4\n"; -print $!{ENOSPC} ? "ok 5\n" : "not ok 5\n"; -$z = close FULL; -print $z ? "ok 6\n" : "not ok 6 # z=$s; $!\n";