ID: 15125
User updated by: [EMAIL PROTECTED]
Old Summary: pnctl_signal does not handle class's as callbacks - patch
included
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: *Extensibility Functions
Operating System: Linux
PHP Version: 4.0CVS-2002-01-20
New Comment:
Ok, forgot to modify your hash table... - this one doesnt segfault :)
Index: pcntl.c
===================================================================
RCS file: /repository/php4/ext/pcntl/pcntl.c,v
retrieving revision 1.18
diff -u -r1.18 pcntl.c
--- pcntl.c 4 Jan 2002 14:08:25 -0000 1.18
+++ pcntl.c 20 Jan 2002 16:20:50 -0000
@@ -483,21 +483,15 @@
RETURN_TRUE;
}
- if (Z_TYPE_PP(handle)!=IS_STRING) {
- php_error(E_WARNING, "Invalid type specified for handle
argument in %s", get_active_function_name(TSRMLS_C));
- RETURN_FALSE;
- }
-
- convert_to_string_ex(handle); /* Just in case */
if (!zend_is_callable(*handle, 0, &func_name)) {
- php_error(E_WARNING, "%s: %s is not a callable function
name error", get_active_function_name(TSRMLS_C), func_name);
+ php_error(E_WARNING, "%s: argument 2 is not a callable
function or method", get_active_function_name(TSRMLS_C));
efree(func_name);
RETURN_FALSE;
}
efree(func_name);
/* Add the function name to our signal table */
- zend_hash_index_update(&PCNTL_G(php_signal_table),
Z_LVAL_PP(signo), Z_STRVAL_PP(handle), (Z_STRLEN_PP(handle) + 1) *
sizeof(char), NULL);
+ zend_hash_index_update(&PCNTL_G(php_signal_table),
Z_LVAL_PP(signo), &handle, sizeof(zval *), NULL);
if (php_signal(Z_LVAL_PP(signo),
pcntl_signal_handler)==SIG_ERR) {
php_error(E_WARNING, "Error assigning singal in
%s", get_active_function_name(TSRMLS_C));
Previous Comments:
------------------------------------------------------------------------
[2002-01-20 10:57:11] [EMAIL PROTECTED]
Have a go with this.- I'm assuming that zend_is_callable works like
php_gtk_is_callable...
regards
alan
Index: pcntl.c
===================================================================
RCS file: /repository/php4/ext/pcntl/pcntl.c,v
retrieving revision 1.18
diff -u -r1.18 pcntl.c
--- pcntl.c 4 Jan 2002 14:08:25 -0000 1.18
+++ pcntl.c 20 Jan 2002 15:51:50 -0000
@@ -483,14 +483,8 @@
RETURN_TRUE;
}
- if (Z_TYPE_PP(handle)!=IS_STRING) {
- php_error(E_WARNING, "Invalid type specified for handle
argument in %s", get_active_function_name(TSRMLS_C));
- RETURN_FALSE;
- }
-
- convert_to_string_ex(handle); /* Just in case */
if (!zend_is_callable(*handle, 0, &func_name)) {
- php_error(E_WARNING, "%s: %s is not a callable function
name error", get_active_function_name(TSRMLS_C), func_name);
+ php_error(E_WARNING, "%s: argument 2 is not a callable
function or method", get_active_function_name(TSRMLS_C));
efree(func_name);
RETURN_FALSE;
}
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=15125&edit=1
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]