Skip to content

Commit 333b1bf

Browse files
author
Jason Greene
committed
Fix casting wierdness that broke compiled code with Sun CC.
(Also easier to read)
1 parent 0216627 commit 333b1bf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ext/pcntl/pcntl.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ PHP_FUNCTION(pcntl_signal)
256256
/* }}} */
257257

258258
/* Note Old */
259-
/* Our custom signal handler that calls the appropriate php_function */
260259
static void old_pcntl_signal_handler(int signo)
261260
{
262261
char *func_name;
@@ -286,7 +285,7 @@ static void old_pcntl_signal_handler(int signo)
286285
return;
287286
}
288287

289-
288+
/* Our custom signal handler that calls the appropriate php_function */
290289
static void pcntl_signal_handler(int signo)
291290
{
292291
long signal_num=signo;
@@ -362,12 +361,13 @@ void pcntl_zend_extension_statement_handler(zend_op_array *op_array) {
362361

363362
/* Traverse through our signal queue and call the appropriate php functions */
364363
for (element=(&PCNTL_G(php_signal_queue))->head; element; element=element->next) {
365-
if (zend_hash_index_find(&PCNTL_G(php_signal_table), (long) *element->data, (void *) &func_name)==FAILURE) {
364+
long *signal_num=(long *)&element->data;
365+
if (zend_hash_index_find(&PCNTL_G(php_signal_table), *signal_num, (void *) &func_name)==FAILURE) {
366366
continue;
367367
}
368368
convert_to_long_ex(&param);
369369
convert_to_string_ex(&call_name);
370-
ZVAL_LONG(param, (long) *element->data);
370+
ZVAL_LONG(param, *signal_num);
371371
ZVAL_STRING(call_name, func_name, 0);
372372

373373
/* Call php singal handler - Note that we do not report errors, and we ignore the return value */

0 commit comments

Comments
 (0)