From: Jani Taskinen Date: Thu, 12 Jul 2007 11:03:46 +0000 (+0000) Subject: MFH: - Fixed bug #41815 (Concurrent read/write fails when EOF is reached) X-Git-Tag: php-5.2.4RC1~170 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=efe310579e1748b9dc706cce0633073a70b03b4f;p=php MFH: - Fixed bug #41815 (Concurrent read/write fails when EOF is reached) --- diff --git a/NEWS b/NEWS index 54a0b45ea9..14721d253f 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,7 @@ PHP NEWS (Dmitry, Andrei Nigmatulin) - Changed mail() function to be always available. (Johannes) +- Added check for unknown options passed to configure. (Jani) - Added persistent connection status checker to pdo_pgsql. (Elvis Pranskevichus, Ilia) - Added support for ATTR_TIMEOUT inside pdo_pgsql driver. (Ilia) @@ -74,6 +75,7 @@ PHP NEWS a node's siblings). (Rob) - Fixed bug #41845 (pgsql extension does not compile with PostgreSQL <7.4). (Ilia) +- Fixed bug #41815 (Concurrent read/write fails when EOF is reached). (Sascha) - Fixed bug #41813 (segmentation fault when using string offset as an object). (judas dot iscariote at gmail dot com, Tony) - Fixed bug #41795 (checkdnsrr does not support DNS_TXT type). diff --git a/ext/standard/tests/file/bug41815.phpt b/ext/standard/tests/file/bug41815.phpt new file mode 100644 index 0000000000..876e6d71c6 --- /dev/null +++ b/ext/standard/tests/file/bug41815.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #41815 (Concurrent read/write fails when EOF is reached) +--FILE-- + 0) { + echo "OK\n"; +} + +@unlink($filename); + +echo "Done\n"; +?> +--EXPECTF-- +OK +Done diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index cf5858aac0..3073314992 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -329,9 +329,6 @@ static size_t php_stdiop_read(php_stream *stream, char *buf, size_t count TSRMLS assert(data != NULL); if (data->fd >= 0) { - if (stream->eof && !data->is_pipe) { - return 0; - } ret = read(data->fd, buf, count); if (ret == (size_t)-1 && errno == EINTR) {