Skip to content

Commit d8ee89d

Browse files
committed
Merge branch 'PHP-8.2'
* PHP-8.2: Fix interrupted CLI output causing the process to exit
2 parents 3b0e619 + b9bf9ee commit d8ee89d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sapi/cli/php_cli.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ PHP_CLI_API ssize_t sapi_cli_single_write(const char *str, size_t str_length) /*
263263
#ifdef PHP_WRITE_STDOUT
264264
do {
265265
ret = write(STDOUT_FILENO, str, str_length);
266-
} while (ret <= 0 && errno == EAGAIN && sapi_cli_select(STDOUT_FILENO));
266+
} while (ret <= 0 && (errno == EINTR || (errno == EAGAIN && sapi_cli_select(STDOUT_FILENO))));
267267
#else
268268
ret = fwrite(str, 1, MIN(str_length, 16384), stdout);
269269
if (ret == 0 && ferror(stdout)) {

0 commit comments

Comments
 (0)