MFH: - Fixed bug #41815 (Concurrent read/write fails when EOF is reached)

This commit is contained in:
Jani Taskinen 2007-07-12 11:03:46 +00:00
parent ed10530eb5
commit efe310579e
3 changed files with 26 additions and 3 deletions

2
NEWS
View File

@ -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).

View File

@ -0,0 +1,24 @@
--TEST--
Bug #41815 (Concurrent read/write fails when EOF is reached)
--FILE--
<?php
$filename = dirname(__FILE__)."/concur_rw.txt";
@unlink($filename);
$writer = fopen($filename, "w");
$reader = fopen($filename, "r");
fread($reader, 1);
fwrite($writer, "foo");
if (strlen(fread($reader, 10)) > 0) {
echo "OK\n";
}
@unlink($filename);
echo "Done\n";
?>
--EXPECTF--
OK
Done

View File

@ -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) {