summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorBo Lindbergh <blgl@hagernas.com>2007-01-20 03:39:57 +0100
committerSteve Peters <steve@fisharerojo.org>2007-01-20 03:40:23 +0000
commitf3be372353a263b94b1bb39fd4c8da0548050a63 (patch)
treefac66820299cded1d956f3cdc6e4452e425963b7 /perlio.c
parentc3f5e0b6decb7359e3cd9e1f8f8ed57b00f14936 (diff)
downloadperl-f3be372353a263b94b1bb39fd4c8da0548050a63.tar.gz
Re: Race condition in IPC::Open3 / Mac OS?
Message-Id: <D256CF03-D814-4973-9DF6-60EA4F26FE10@hagernas.com> p4raw-id: //depot/perl@29894
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/perlio.c b/perlio.c
index 6e2d9e1570..939665021f 100644
--- a/perlio.c
+++ b/perlio.c
@@ -3419,9 +3419,15 @@ PerlIOStdio_fill(pTHX_ PerlIO *f)
if (PerlSIO_fflush(stdio) != 0)
return EOF;
}
- c = PerlSIO_fgetc(stdio);
- if (c == EOF)
- return EOF;
+ for (;;) {
+ c = PerlSIO_fgetc(stdio);
+ if (c != EOF)
+ break;
+ if (! PerlSIO_ferror(stdio) || errno != EINTR)
+ return EOF;
+ PERL_ASYNC_CHECK();
+ SETERRNO(0,0);
+ }
#if (defined(STDIO_PTR_LVALUE) && (defined(STDIO_CNT_LVALUE) || defined(STDIO_PTR_LVAL_SETS_CNT)))