diff options
-rw-r--r-- | Zend/zend_API.c | 16 | ||||
-rw-r--r-- | Zend/zend_API.h | 4 | ||||
-rw-r--r-- | ext/standard/dl.c | 2 | ||||
-rw-r--r-- | main/main.c | 2 |
4 files changed, 12 insertions, 12 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c index b4338c7f74..0dad35cea2 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -1328,14 +1328,14 @@ ZEND_API int zend_startup_modules(TSRMLS_D) return SUCCESS; } -ZEND_API int zend_register_module_ex(zend_module_entry *module TSRMLS_DC) +ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module TSRMLS_DC) { int name_len; char *lcname; zend_module_entry *module_ptr; if (!module) { - return FAILURE; + return NULL; } #if 0 @@ -1355,7 +1355,7 @@ ZEND_API int zend_register_module_ex(zend_module_entry *module TSRMLS_DC) efree(lcname); /* TODO: Check version relationship */ zend_error(E_CORE_WARNING, "Cannot load module '%s' because conflicting module '%s' is already loaded", module->name, dep->name); - return FAILURE; + return NULL; } efree(lcname); } @@ -1369,20 +1369,20 @@ ZEND_API int zend_register_module_ex(zend_module_entry *module TSRMLS_DC) if (zend_hash_add(&module_registry, lcname, name_len+1, (void *)module, sizeof(zend_module_entry), (void**)&module_ptr)==FAILURE) { zend_error(E_CORE_WARNING, "Module '%s' already loaded", module->name); efree(lcname); - return FAILURE; + return NULL; } efree(lcname); module = module_ptr; if (module->functions && zend_register_functions(NULL, module->functions, NULL, module->type TSRMLS_CC)==FAILURE) { zend_error(E_CORE_WARNING,"%s: Unable to register functions, unable to load", module->name); - return FAILURE; + return NULL; } - return SUCCESS; + return module; } -ZEND_API int zend_register_internal_module(zend_module_entry *module TSRMLS_DC) +ZEND_API zend_module_entry* zend_register_internal_module(zend_module_entry *module TSRMLS_DC) { module->module_number = zend_next_free_module(); module->type = MODULE_PERSISTENT; @@ -1656,7 +1656,7 @@ ZEND_API int zend_startup_module(zend_module_entry *module) { TSRMLS_FETCH(); - if (zend_register_internal_module(module TSRMLS_CC) == SUCCESS && + if ((module = zend_register_internal_module(module TSRMLS_CC)) != NULL && zend_startup_module_ex(module TSRMLS_CC) == SUCCESS) { return SUCCESS; } diff --git a/Zend/zend_API.h b/Zend/zend_API.h index d8833a237c..e28fa1b7c6 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -178,8 +178,8 @@ ZEND_API int zend_parse_method_parameters_ex(int flags, int num_args TSRMLS_DC, ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entry *functions, HashTable *function_table, int type TSRMLS_DC); ZEND_API void zend_unregister_functions(zend_function_entry *functions, int count, HashTable *function_table TSRMLS_DC); ZEND_API int zend_startup_module(zend_module_entry *module_entry); -ZEND_API int zend_register_internal_module(zend_module_entry *module_entry TSRMLS_DC); -ZEND_API int zend_register_module_ex(zend_module_entry *module TSRMLS_DC); +ZEND_API zend_module_entry* zend_register_internal_module(zend_module_entry *module_entry TSRMLS_DC); +ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module TSRMLS_DC); ZEND_API int zend_startup_module_ex(zend_module_entry *module TSRMLS_DC); ZEND_API int zend_startup_modules(TSRMLS_D); ZEND_API void zend_check_magic_method_implementation(zend_class_entry *ce, zend_function *fptr, int error_type TSRMLS_DC); diff --git a/ext/standard/dl.c b/ext/standard/dl.c index 65cc533b61..278950d5fa 100644 --- a/ext/standard/dl.c +++ b/ext/standard/dl.c @@ -219,7 +219,7 @@ void php_dl(zval *file, int type, zval *return_value TSRMLS_DC) module_entry->module_number = zend_next_free_module(); module_entry->handle = handle; - if (zend_register_module_ex(module_entry TSRMLS_CC) == FAILURE) { + if ((module_entry = zend_register_module_ex(module_entry TSRMLS_CC)) == NULL) { DL_UNLOAD(handle); RETURN_FALSE; } diff --git a/main/main.c b/main/main.c index 9c17d0fcb8..6c511e21b5 100644 --- a/main/main.c +++ b/main/main.c @@ -1296,7 +1296,7 @@ int php_register_extensions(zend_module_entry **ptr, int count TSRMLS_DC) while (ptr < end) { if (*ptr) { - if (zend_register_internal_module(*ptr TSRMLS_CC)==FAILURE) { + if (zend_register_internal_module(*ptr TSRMLS_CC)==NULL) { return FAILURE; } } |