1
0
mirror of https://github.com/php/php-src.git synced 2026-04-08 16:43:44 +02:00

Return FALSE if error_log fails to write all bytes

This commit is contained in:
Adam Saponara
2017-03-09 14:27:01 -05:00
committed by Nikita Popov
parent 7fba8bda4c
commit 98f4ce9363

View File

@@ -4682,6 +4682,7 @@ PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers)
PHPAPI int _php_error_log_ex(int opt_err, char *message, size_t message_len, char *opt, char *headers) /* {{{ */
{
php_stream *stream = NULL;
size_t nbytes;
switch (opt_err)
{
@@ -4701,8 +4702,11 @@ PHPAPI int _php_error_log_ex(int opt_err, char *message, size_t message_len, cha
if (!stream) {
return FAILURE;
}
php_stream_write(stream, message, message_len);
nbytes = php_stream_write(stream, message, message_len);
php_stream_close(stream);
if (nbytes != message_len) {
return FAILURE;
}
break;
case 4: /* send to SAPI */