From 42a7a32faa5272696f9e7f961a7335824698429d Mon Sep 17 00:00:00 2001 From: Nick Ing-Simmons Date: Sun, 18 May 2003 18:19:42 +0000 Subject: [PATCH] EINTR retry should exit on count >= 0 not !=0 p4raw-id: //depot/perlio@19557 --- perlio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; } -- 2.7.4