summaryrefslogtreecommitdiff
path: root/ext/session/mod_files.c
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2002-09-25 12:38:45 +0000
committerSascha Schumann <sas@php.net>2002-09-25 12:38:45 +0000
commit03c07308d3c077466c6015becfa5e27198f5552b (patch)
treecd3e050905c26281ffffd4ba1ed4b701f2f948aa /ext/session/mod_files.c
parent322a24a5262743a8e7c904b7a8c435be17a17160 (diff)
downloadphp-git-03c07308d3c077466c6015becfa5e27198f5552b.tar.gz
Improve error messages
Diffstat (limited to 'ext/session/mod_files.c')
-rw-r--r--ext/session/mod_files.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c
index 52dddadc6d..89b894d29b 100644
--- a/ext/session/mod_files.c
+++ b/ext/session/mod_files.c
@@ -275,6 +275,10 @@ PS_READ_FUNC(files)
#endif
if (n != sbuf.st_size) {
+ if (n == -1)
+ php_error(E_WARNING, "read failed: %s (%d)", strerror(errno), errno);
+ else
+ php_error(E_WARNING, "read returned less bytes than requested");
efree(*val);
return FAILURE;
}
@@ -307,7 +311,10 @@ PS_WRITE_FUNC(files)
#endif
if (n != vallen) {
- php_error(E_WARNING, "write failed: %s (%d)", strerror(errno), errno);
+ if (n == -1)
+ php_error(E_WARNING, "write failed: %s (%d)", strerror(errno), errno);
+ else
+ php_error(E_WARNING, "write wrote less bytes than requested");
return FAILURE;
}