summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2004-01-18 06:51:23 -0600
committerH.Merijn Brand <h.m.brand@xs4all.nl>2004-01-19 10:41:24 +0000
commit7659f3199f910ecba805d8e66673aebf3f976173 (patch)
treecddfc7f644dcf321e3bee5f3a6650dce68e71be5 /perlio.c
parent02e1c2f1c4f0858353f9cc49bc10789e69f32bb5 (diff)
downloadperl-7659f3199f910ecba805d8e66673aebf3f976173.tar.gz
rescue PerlIO_getname for VMS
From: "Craig A. Berry" <craigberry@mac.com> Message-ID: <400AD5AB.3080708@mac.com> p4raw-id: //depot/perl@22174
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/perlio.c b/perlio.c
index f058df9a6b..87ac75f4a5 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