summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2015-10-17 18:11:37 -0400
committerSteve Hay <steve.m.hay@googlemail.com>2015-10-26 08:12:36 +0000
commite8e6832faf634ae8e2070943a88ebc61365ea548 (patch)
tree350e3cfb95a27ebf658ee1c90f0e635463bd6e23
parent7a6095a56c9cd85ae9ff46603b117489e66f863b (diff)
downloadperl-e8e6832faf634ae8e2070943a88ebc61365ea548.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. (cherry picked from commit bdae4172ce49ee233037d3e6af7dbeea521d0562)
-rw-r--r--perlio.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/perlio.c b/perlio.c
index 92fa2bea84..b8ee074708 100644
--- a/perlio.c
+++ b/perlio.c
@@ -3355,6 +3355,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;
}