Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions ext/pcntl/pcntl.c
Original file line number Diff line number Diff line change
Expand Up @@ -798,15 +798,16 @@ PHP_FUNCTION(pcntl_signal)
RETURN_THROWS();
}

/* Add the function name to our signal table */
handle = zend_hash_index_update(&PCNTL_G(php_signal_table), signo, handle);
Z_TRY_ADDREF_P(handle);

/* Register with the OS first so that on failure we don't record a handler that was never installed */
if (php_signal4(signo, pcntl_signal_handler, (int) restart_syscalls, 1) == (void *)SIG_ERR) {
PCNTL_G(last_error) = errno;
php_error_docref(NULL, E_WARNING, "Error assigning signal");
RETURN_FALSE;
}

/* Add the function name to our signal table */
handle = zend_hash_index_update(&PCNTL_G(php_signal_table), signo, handle);
Z_TRY_ADDREF_P(handle);
RETURN_TRUE;
}
/* }}} */
Expand Down
Loading