diff options
author | Hans Mulder <hansmu@xs4all.nl> | 1998-07-09 09:51:27 -0700 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-07-10 21:53:06 +0000 |
commit | bf6b5eb4157d8ec84b03a82e6575ebd58812ca0a (patch) | |
tree | 229fc8830f3582d86b18eb7443331dfc0c7bc50a /vms/vms.c | |
parent | 09d9d2303429a2231723b666dcb3f080fcc91bff (diff) | |
download | perl-bf6b5eb4157d8ec84b03a82e6575ebd58812ca0a.tar.gz |
make binmode(STDIN) not whine
Message-Id: <3.0.5.32.19980709165127.00a692e0@ous.edu>
Subject: [PATCH 5.004_70] Fix up binmode() for VMS
p4raw-id: //depot/perl@1411
Diffstat (limited to 'vms/vms.c')
-rw-r--r-- | vms/vms.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -4168,7 +4168,7 @@ my_binmode(FILE *fp, char iotype) if (s == dirend + 3) return fp; /* If we've got a non-file-structured device, clip off the trailing * junk, and don't lose sleep if we can't get a stream position. */ - if (dirend == Nullch) *(colon+1) = '\0'; + if (dirend == Nullch) *(colon+1) = '\0'; if (iotype != '-'&& (ret = fgetpos(fp, &pos)) == -1 && dirend) return NULL; switch (iotype) { case '<': case 'r': acmode = "rb"; break; @@ -4178,8 +4178,12 @@ my_binmode(FILE *fp, char iotype) case 'a': acmode = "ab"; break; case '+': case 's': acmode = "rb+"; break; case '-': acmode = fileno(fp) ? "ab" : "rb"; break; + /* iotype'll be null for the SYS$INPUT:/SYS$OUTPUT:/SYS$ERROR: files */ + /* since we didn't really open them and can't really */ + /* reopen them */ + case 0: return NULL; break; default: - warn("Unrecognized iotype %c in my_binmode",iotype); + warn("Unrecognized iotype %x for %s in my_binmode",iotype, filespec); acmode = "rb+"; } if (freopen(filespec,acmode,fp) == NULL) return NULL; |