]> granicus.if.org Git - php/commitdiff
Fixed EOF handling in case of reading from file opened in write only mode.
authorDmitry Stogov <dmitry@php.net>
Wed, 25 Jul 2007 16:34:06 +0000 (16:34 +0000)
committerDmitry Stogov <dmitry@php.net>
Wed, 25 Jul 2007 16:34:06 +0000 (16:34 +0000)
NEWS
ext/standard/tests/file/fgets_variation1.phpt
ext/standard/tests/file/fread_variation4-win32.phpt
ext/standard/tests/file/fread_variation4.phpt
main/streams/plain_wrapper.c

diff --git a/NEWS b/NEWS
index be6e96bff8f47ac720ad79277707563143ca16c1..dd40f9293d5d92dae5df3cb4aaf9d8fbe7073a52 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -41,6 +41,8 @@ PHP                                                                        NEWS
 - Implemented FR #41884 (ReflectionClass::getDefaultProperties() does not handle 
   static attributes). (Tony)
 
+- Fixed EOF handling in case of reading from file opened in write only mode.
+  (Dmitry)
 - Fixed "Floating point exception" inside wordwrap(). (Mattias Bengtsson,
   Ilia)
 - Fixed crash in OpenSSL extension because of non-string passphrase. (Dmitry)
index dbd51c6bbeee886ab52fba8072dfe09d434b1952..48ea231194c9202c494d77e377fb88412e8ccc0f 100644 (file)
@@ -84,7 +84,7 @@ int(0)
 bool(false)
 bool(false)
 int(0)
-bool(true)
+bool(false)
 -- File opened in mode : at --
 bool(true)
 int(0)
index adfed312a5a47b73a0ffeb54de1ada0e27e33b47..77d733a50e440dd57e798d7d09548bcd2791ba7d 100644 (file)
@@ -117,117 +117,117 @@ int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode ab --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode at --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode w --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode wb --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode wt --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode x --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode xb --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode xt --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 
 -- Testing fread() with file having content of type text --
 -- File opened in mode a --
@@ -236,117 +236,117 @@ int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode ab --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode at --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode w --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode wb --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode wt --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode x --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode xb --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode xt --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 
 -- Testing fread() with file having content of type text_with_new_line --
 -- File opened in mode a --
@@ -355,115 +355,115 @@ int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode ab --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode at --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode w --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode wb --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode wt --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1137)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1137)
-bool(true)
+bool(false)
 -- File opened in mode x --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode xb --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode xt --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1137)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1137)
-bool(true)
+bool(false)
 Done
\ No newline at end of file
index 1c21b9b5d1773a90101f39101584d6eddac37694..fdff8de704ece6f2e7d50ace78fb3e994842c84d 100644 (file)
@@ -117,117 +117,117 @@ int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode ab --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode at --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode w --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode wb --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode wt --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode x --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode xb --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode xt --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 
 -- Testing fread() with file having content of type text --
 -- File opened in mode a --
@@ -236,117 +236,117 @@ int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode ab --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode at --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode w --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode wb --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode wt --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode x --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode xb --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode xt --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 
 -- Testing fread() with file having content of type text_with_new_line --
 -- File opened in mode a --
@@ -355,115 +355,115 @@ int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode ab --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode at --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode w --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode wb --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode wt --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode x --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode xb --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 -- File opened in mode xt --
 -- Reading beyond filesize, expeceted : 1024 bytes --
 int(0)
 bool(false)
 Reading 1030 bytes from file, expecting 0 bytes ... OK
 int(0)
-bool(true)
+bool(false)
 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
 int(1024)
 bool(false)
 Reading 10 bytes from file, expecting 0 bytes ... OK
 int(1024)
-bool(true)
+bool(false)
 Done
\ No newline at end of file
index 307331499236a6b2f9e03afc84563ec4f2cfca9b..74c1841950b66346bccb17b42ec0cbb9e430bf53 100644 (file)
@@ -338,7 +338,7 @@ static size_t php_stdiop_read(php_stream *stream, char *buf, size_t count TSRMLS
                        ret = read(data->fd, buf, count);
                }
 
-               stream->eof = (ret == 0 || (ret == (size_t)-1 && errno != EWOULDBLOCK && errno != EINTR));
+               stream->eof = (ret == 0 || (ret == (size_t)-1 && errno != EWOULDBLOCK && errno != EINTR && errno != EBADF));
                                
        } else {
 #if HAVE_FLUSHIO