From: Craig A. Berry Date: Sun, 18 Jan 2004 12:51:23 +0000 (-0600) Subject: rescue PerlIO_getname for VMS X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7659f3199f910ecba805d8e66673aebf3f976173;p=p5sagit%2Fp5-mst-13.2.git rescue PerlIO_getname for VMS From: "Craig A. Berry" Message-ID: <400AD5AB.3080708@mac.com> p4raw-id: //depot/perl@22174 --- diff --git a/perlio.c b/perlio.c index f058df9..87ac75f 100644 --- a/perlio.c +++ b/perlio.c @@ -4718,9 +4718,16 @@ PerlIO_getname(PerlIO *f, char *buf) dTHX; char *name = NULL; #ifdef VMS + bool exported = FALSE; FILE *stdio = PerlIOSelf(f, PerlIOStdio)->stdio; - if (stdio) + if (!stdio) { + stdio = PerlIO_exportFILE(f,0); + exported = TRUE; + } + if (stdio) { name = fgetname(stdio, buf); + if (exported) PerlIO_releaseFILE(f,stdio); + } #else Perl_croak(aTHX_ "Don't know how to get file name"); #endif