From: Nick Ing-Simmons Date: Sun, 18 May 2003 10:29:26 +0000 (+0000) Subject: Fix ticket 18265 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ba85f2eaa56f5ba4c56314d0bcbc2c8a81e0813d;p=p5sagit%2Fp5-mst-13.2.git Fix ticket 18265 p4raw-id: //depot/perlio@19556 --- diff --git a/perlio.c b/perlio.c index cab4243..13b553e 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();