summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2015-10-17 18:11:37 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2015-10-17 22:16:25 -0400
commitbdae4172ce49ee233037d3e6af7dbeea521d0562 (patch)
treea49fd12b698873b1486ed9e4036aca3145272d0f /perlio.c
parent6aba156ffbafbf27a3ba4f313d90ed712fc4e5d4 (diff)
downloadperl-bdae4172ce49ee233037d3e6af7dbeea521d0562.tar.gz
rt.perl.org #123977 - clear errno in IRIX PERLIO=stdio
Under some circumstances IRIX stdio fgetc() and fread() set the errno to ENOENT, which makes no sense according to either IRIX or POSIX docs. Just clear such an errno.
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/perlio.c b/perlio.c
index ae8cbc9423..8ab47e4936 100644
--- a/perlio.c
+++ b/perlio.c
@@ -3332,6 +3332,12 @@ PerlIOStdio_read(pTHX_ PerlIO *f, void *vbuf, Size_t count)
return -1;
SETERRNO(0,0); /* just in case */
}
+#ifdef __sgi
+ /* Under some circumstances IRIX stdio fgetc() and fread()
+ * set the errno to ENOENT, which makes no sense according
+ * to either IRIX or POSIX. [rt.perl.org #123977] */
+ if (errno == ENOENT) SETERRNO(0,0);
+#endif
return got;
}