summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2003-05-18 10:29:26 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2003-05-18 10:29:26 +0000
commitba85f2eaa56f5ba4c56314d0bcbc2c8a81e0813d (patch)
tree84256c942503cc8fcc3f24b154445c9760bee7e8 /perlio.c
parenta7cae0a99e12a8400a0e277aa1431f3c2c3f004d (diff)
downloadperl-ba85f2eaa56f5ba4c56314d0bcbc2c8a81e0813d.tar.gz
Fix ticket 18265
p4raw-id: //depot/perlio@19556
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/perlio.c b/perlio.c
index cab42430e6..13b553e681 100644
--- a/perlio.c
+++ b/perlio.c
@@ -2452,10 +2452,15 @@ PerlIOUnix_read(pTHX_ PerlIO *f, void *vbuf, Size_t count)
while (1) {
SSize_t len = PerlLIO_read(fd, vbuf, count);
if (len >= 0 || errno != EINTR) {
- if (len < 0)
- PerlIOBase(f)->flags |= PERLIO_F_ERROR;
- else if (len == 0 && count != 0)
+ if (len < 0) {
+ if (errno != EAGAIN) {
+ PerlIOBase(f)->flags |= PERLIO_F_ERROR;
+ }
+ }
+ else if (len == 0 && count != 0) {
PerlIOBase(f)->flags |= PERLIO_F_EOF;
+ SETERRNO(0,0);
+ }
return len;
}
PERL_ASYNC_CHECK();
@@ -2469,8 +2474,11 @@ PerlIOUnix_write(pTHX_ PerlIO *f, const void *vbuf, Size_t count)
while (1) {
SSize_t len = PerlLIO_write(fd, vbuf, count);
if (len >= 0 || errno != EINTR) {
- if (len < 0)
- PerlIOBase(f)->flags |= PERLIO_F_ERROR;
+ if (len < 0) {
+ if (errno != EAGAIN) {
+ PerlIOBase(f)->flags |= PERLIO_F_ERROR;
+ }
+ }
return len;
}
PERL_ASYNC_CHECK();