]> granicus.if.org Git - php/commitdiff
MFH: - Fixed bug #41815 (Concurrent read/write fails when EOF is reached)
authorJani Taskinen <jani@php.net>
Thu, 12 Jul 2007 11:03:46 +0000 (11:03 +0000)
committerJani Taskinen <jani@php.net>
Thu, 12 Jul 2007 11:03:46 +0000 (11:03 +0000)
NEWS
ext/standard/tests/file/bug41815.phpt [new file with mode: 0644]
main/streams/plain_wrapper.c

diff --git a/NEWS b/NEWS
index 54a0b45ea9c1938a30a35cc9a852004e4760987e..14721d253f4a40f56f553c42e0a7d814f8036c33 100644 (file)
--- 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 (file)
index 0000000..876e6d7
--- /dev/null
@@ -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
index cf5858aac039e1919400e1b55be1d6819707c520..307331499236a6b2f9e03afc84563ec4f2cfca9b 100644 (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) {