diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2003-05-18 10:29:26 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2003-05-18 10:29:26 +0000 |
commit | ba85f2eaa56f5ba4c56314d0bcbc2c8a81e0813d (patch) | |
tree | 84256c942503cc8fcc3f24b154445c9760bee7e8 /perlio.c | |
parent | a7cae0a99e12a8400a0e277aa1431f3c2c3f004d (diff) | |
download | perl-ba85f2eaa56f5ba4c56314d0bcbc2c8a81e0813d.tar.gz |
Fix ticket 18265
p4raw-id: //depot/perlio@19556
Diffstat (limited to 'perlio.c')
-rw-r--r-- | perlio.c | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -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(); |