Skip to content

Commit 2041c9a

Browse files
committed
Merge branch 'PHP-7.4'
2 parents 32b87f8 + e98e1f9 commit 2041c9a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

ext/pcntl/pcntl.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,8 +941,9 @@ PHP_FUNCTION(pcntl_signal)
941941
zval *handle;
942942
zend_long signo;
943943
zend_bool restart_syscalls = 1;
944+
zend_bool restart_syscalls_is_null = 1;
944945

945-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "lz|b", &signo, &handle, &restart_syscalls) == FAILURE) {
946+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "lz|b!", &signo, &handle, &restart_syscalls, &restart_syscalls_is_null) == FAILURE) {
946947
return;
947948
}
948949

@@ -964,6 +965,13 @@ PHP_FUNCTION(pcntl_signal)
964965
}
965966
}
966967

968+
/* If restart_syscalls was not explicitly specified and the signal is SIGALRM, then default
969+
* restart_syscalls to false. PHP used to enforce that restart_syscalls is false for SIGALRM,
970+
* so we keep this differing default to reduce the degree of BC breakage. */
971+
if (restart_syscalls_is_null && signo == SIGALRM) {
972+
restart_syscalls = 0;
973+
}
974+
967975
/* Special long value case for SIG_DFL and SIG_IGN */
968976
if (Z_TYPE_P(handle) == IS_LONG) {
969977
if (Z_LVAL_P(handle) != (zend_long) SIG_DFL && Z_LVAL_P(handle) != (zend_long) SIG_IGN) {

ext/pcntl/php_signal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Sigfunc *php_signal4(int signo, Sigfunc *func, int restart, int mask_all)
3939
#ifdef HAVE_STRUCT_SIGINFO_T
4040
act.sa_flags |= SA_SIGINFO;
4141
#endif
42-
if (signo == SIGALRM || (! restart)) {
42+
if (!restart) {
4343
#ifdef SA_INTERRUPT
4444
act.sa_flags |= SA_INTERRUPT; /* SunOS */
4545
#endif

0 commit comments

Comments
 (0)