From: Nick Ing-Simmons Date: Sun, 18 May 2003 18:19:42 +0000 (+0000) Subject: EINTR retry should exit on count >= 0 not !=0 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=42a7a32faa5272696f9e7f961a7335824698429d;p=p5sagit%2Fp5-mst-13.2.git EINTR retry should exit on count >= 0 not !=0 p4raw-id: //depot/perlio@19557 --- diff --git a/perlio.c b/perlio.c index 13b553e..765882e 100644 --- a/perlio.c +++ b/perlio.c @@ -2980,10 +2980,10 @@ PerlIOStdio_read(pTHX_ PerlIO *f, void *vbuf, Size_t count) } else got = PerlSIO_fread(vbuf, 1, count, s); - if (got || errno != EINTR) + if (got >= 0 || errno != EINTR) break; PERL_ASYNC_CHECK(); - errno = 0; /* just in case */ + SETERRNO(0,0); /* just in case */ } return got; } @@ -3053,10 +3053,10 @@ PerlIOStdio_write(pTHX_ PerlIO *f, const void *vbuf, Size_t count) for (;;) { got = PerlSIO_fwrite(vbuf, 1, count, PerlIOSelf(f, PerlIOStdio)->stdio); - if (got || errno != EINTR) + if (got >= 0 || errno != EINTR) break; PERL_ASYNC_CHECK(); - errno = 0; /* just in case */ + SETERRNO(0,0); /* just in case */ } return got; }