mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Improve error messages
This commit is contained in:
parent
322a24a526
commit
03c07308d3
1 changed files with 8 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue