From: Richard Clamp Date: Sun, 11 Aug 2002 15:52:24 +0000 (+0100) Subject: Re: PerlIO::via silent failure X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4f776d34be4f213cd24b2ea13cb7dcdd291f4cd6;p=p5sagit%2Fp5-mst-13.2.git Re: PerlIO::via silent failure Message-Id: <20020811145224.GA23897@mirth.demon.co.uk> p4raw-id: //depot/perlio@17795 --- diff --git a/ext/PerlIO/t/via.t b/ext/PerlIO/t/via.t index d40e85e..124efbd 100644 --- a/ext/PerlIO/t/via.t +++ b/ext/PerlIO/t/via.t @@ -14,7 +14,7 @@ BEGIN { my $tmp = "via$$"; -use Test::More tests => 16; +use Test::More tests => 18; my $fh; my $a = join("", map { chr } 0..255) x 10; @@ -58,7 +58,14 @@ is($a, $b, 'compare original data with filtered version'); close($fh); +{ +package Incomplete::Module; +} + $warnings = ''; + no warnings 'layer'; + ok( ! open($fh,">via(Incomplete::Module)", $tmp), 'open via Incomplete::Module will fail'); + is( $warnings, "", "don't warn about unknown package" ); $warnings = ''; no warnings 'layer'; diff --git a/ext/PerlIO/via/via.xs b/ext/PerlIO/via/via.xs index 2bcd355..d454678 100644 --- a/ext/PerlIO/via/via.xs +++ b/ext/PerlIO/via/via.xs @@ -161,6 +161,9 @@ PerlIOVia_pushed(pTHX_ PerlIO * f, const char *mode, SV * arg, else if (SvIV(result) != 0) return SvIV(result); } + else { + goto push_failed; + } if (PerlIOVia_fetchmethod(aTHX_ s, MYMethod(FILL)) == (CV *) - 1) PerlIOBase(f)->flags &= ~PERLIO_F_FASTGETS; @@ -172,6 +175,7 @@ PerlIOVia_pushed(pTHX_ PerlIO * f, const char *mode, SV * arg, Perl_warner(aTHX_ packWARN(WARN_LAYER), "Cannot find package '%.*s'", (int) pkglen, pkg); +push_failed: #ifdef ENOSYS errno = ENOSYS; #else