]> granicus.if.org Git - php/commitdiff
Fix a seg fault in PHP. If a child process is created in the server,
authorRyan Bloom <rbb@php.net>
Fri, 17 Aug 2001 22:25:13 +0000 (22:25 +0000)
committerRyan Bloom <rbb@php.net>
Fri, 17 Aug 2001 22:25:13 +0000 (22:25 +0000)
using apr_proc_create, it will seg fault, because PHP is using a NULL
child cleanup.  To fix this, we have to use the special cleanup function,
apr_pool_cleanup_null.

This also fixes a compiler warning in the ap_log_error call.

sapi/apache2filter/apache_config.c
sapi/apache2filter/sapi_apache2.c

index 2b0ce50c7e071d626b52a16f11523acf5703beb2..a70f926996cdbb19b4d36e85c5b7bf99da17f9f7 100644 (file)
@@ -150,7 +150,7 @@ void *create_php_config(apr_pool_t *p, char *dummy)
 
        phpapdebug((stderr, "Creating new config (%p) for %s\n", newx, dummy));
        zend_hash_init(&newx->config, 0, NULL, NULL, 1);
-       apr_pool_cleanup_register(p, newx, destroy_php_config, NULL);
+       apr_pool_cleanup_register(p, newx, destroy_php_config, apr_pool_cleanup_null);
        return (void *) newx;
 }
 
index 5a57ab1122da86ff6a20853194fdb0ff12181a4c..d50c078417f536d592e0fda8d25f71738cfd8cc6 100644 (file)
@@ -188,7 +188,7 @@ static void php_apache_sapi_log_message(char *msg)
         * line.  Not sure if this is correct, but it mirrors what happens
         * with Apache 1.3 -- rbb
         */
-       ap_log_error(NULL, APLOG_ERR | APLOG_NOERRNO | APLOG_STARTUP, 0, ctx->f->r->server, "%s", msg);
+       ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO | APLOG_STARTUP, 0, ctx->f->r->server, "%s", msg);
 }
 
 static sapi_module_struct apache2_sapi_module = {
@@ -402,7 +402,7 @@ php_apache_server_startup(apr_pool_t *pchild, server_rec *s)
        tsrm_startup(1, 1, 0, NULL);
        sapi_startup(&apache2_sapi_module);
        apache2_sapi_module.startup(&apache2_sapi_module);
-       apr_pool_cleanup_register(pchild, NULL, php_apache_server_shutdown, NULL);
+       apr_pool_cleanup_register(pchild, NULL, php_apache_server_shutdown, apr_pool_cleanup_null);
        php_apache_register_module();
 }