summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Beaver <cellog@php.net>2008-04-28 22:37:31 +0000
committerGreg Beaver <cellog@php.net>2008-04-28 22:37:31 +0000
commitc46d651b3e008e189f351217b8084abaa3a9bda6 (patch)
treed77a19d3f94bd46aa61beabeefb7539db11b1bc6
parentf9300287516b981f56eed460f187c91168012db2 (diff)
downloadphp-git-c46d651b3e008e189f351217b8084abaa3a9bda6.tar.gz
Fixed potentially confusing error message on failure when no errors are logged
-rw-r--r--NEWS1
-rwxr-xr-xmain/streams/streams.c6
2 files changed, 6 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 150a18e7c5..48318c3e0d 100644
--- a/NEWS
+++ b/NEWS
@@ -136,6 +136,7 @@ PHP NEWS
. Added CGI SAPI -T option which can be used to measure execution
time of script repeated several times. (Dmitry)
- Improved streams:
+ . Fixed potentially confusing error message on failure when no errors are logged (Greg)
. Added stream_supports_lock() function. (Benjamin Schulz)
. Added "ignore_errors" option to http fopen wrapper. (David Zulke, Sara)
. Added context parameter for copy() function. (Sara)
diff --git a/main/streams/streams.c b/main/streams/streams.c
index 614470fc7b..3a40e33267 100755
--- a/main/streams/streams.c
+++ b/main/streams/streams.c
@@ -164,7 +164,11 @@ void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, const char *
free_msg = 1;
} else {
- msg = strerror(errno);
+ if (wrapper == &php_plain_files_wrapper) {
+ msg = strerror(errno);
+ } else {
+ msg = "operation failed";
+ }
}
} else {
msg = "no suitable wrapper could be found";