summaryrefslogtreecommitdiff
path: root/vms/ext/Stdio
diff options
context:
space:
mode:
Diffstat (limited to 'vms/ext/Stdio')
-rw-r--r--vms/ext/Stdio/Stdio.pm6
-rw-r--r--vms/ext/Stdio/Stdio.xs6
2 files changed, 7 insertions, 5 deletions
diff --git a/vms/ext/Stdio/Stdio.pm b/vms/ext/Stdio/Stdio.pm
index 275081329c..af71f0bb9e 100644
--- a/vms/ext/Stdio/Stdio.pm
+++ b/vms/ext/Stdio/Stdio.pm
@@ -32,13 +32,15 @@ sub AUTOLOAD {
if ($constname =~ /^O_/) {
my($val) = constant($constname);
defined $val or croak("Unknown VMS::Stdio constant $constname");
- *$AUTOLOAD = sub { $val };
}
else { # We don't know about it; hand off to IO::File
require IO::File;
my($obj) = shift(@_);
- $obj->IO::File::$constname(@_);
+
+ my($val) = eval "\$obj->IO::File::$constname(@_)";
+ croak "Error autoloading $constname: $@" if $@;
}
+ *$AUTOLOAD = sub { $val };
goto &$AUTOLOAD;
}
diff --git a/vms/ext/Stdio/Stdio.xs b/vms/ext/Stdio/Stdio.xs
index 79eb95335e..a1ec91f500 100644
--- a/vms/ext/Stdio/Stdio.xs
+++ b/vms/ext/Stdio/Stdio.xs
@@ -79,8 +79,8 @@ IV *pval;
static SV *
newFH(FILE *fp, char type) {
- SV *rv, *gv = NEWSV(0,0);
- GV **stashp;
+ SV *rv;
+ GV **stashp, *gv = (GV *)NEWSV(0,0);
HV *stash;
IO *io;
@@ -102,7 +102,7 @@ newFH(FILE *fp, char type) {
IoIFP(io) = fp;
if (type != '>') IoOFP(io) = fp;
IoTYPE(io) = type;
- rv = newRV(gv);
+ rv = newRV((SV *)gv);
SvREFCNT_dec(gv);
return sv_bless(rv,stash);
}