diff options
author | Ryan Bloom <rbb@apache.org> | 2000-02-28 19:14:35 +0000 |
---|---|---|
committer | Ryan Bloom <rbb@apache.org> | 2000-02-28 19:14:35 +0000 |
commit | 1087c15ce3bb7b0fb83cb07ed85ecb4203d15bc1 (patch) | |
tree | fb0dba0eb1b05a523cf566523381ad0f746c78ff | |
parent | 256947517bd54f8ea2cab003b28133ed1cc5fe00 (diff) | |
download | apr-1087c15ce3bb7b0fb83cb07ed85ecb4203d15bc1.tar.gz |
Check return code from ap_create_lock.
Submitted by: Jeff Trawick
Reviewed by: Ryan Bloom
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59665 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | lib/apr_pools.c | 8 | ||||
-rw-r--r-- | memory/unix/apr_pools.c | 8 |
2 files changed, 12 insertions, 4 deletions
diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 12fec3d85..224d5a9e0 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -558,16 +558,20 @@ static void dump_stats(void) ap_pool_t *ap_init_alloc(void) { + ap_status_t status1, status2; #ifdef POOL_DEBUG char s; known_stack_point = &s; stack_var_init(&s); #endif - ap_create_lock(&alloc_mutex, APR_MUTEX, APR_INTRAPROCESS, + status1 = ap_create_lock(&alloc_mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, NULL); - ap_create_lock(&spawn_mutex, APR_MUTEX, APR_INTRAPROCESS, + status2 = ap_create_lock(&spawn_mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, NULL); + if (status1 != APR_SUCCESS || status2 != APR_SUCCESS) { + return NULL; + } permanent_pool = ap_make_sub_pool(NULL, NULL); #ifdef ALLOC_STATS diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 12fec3d85..224d5a9e0 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -558,16 +558,20 @@ static void dump_stats(void) ap_pool_t *ap_init_alloc(void) { + ap_status_t status1, status2; #ifdef POOL_DEBUG char s; known_stack_point = &s; stack_var_init(&s); #endif - ap_create_lock(&alloc_mutex, APR_MUTEX, APR_INTRAPROCESS, + status1 = ap_create_lock(&alloc_mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, NULL); - ap_create_lock(&spawn_mutex, APR_MUTEX, APR_INTRAPROCESS, + status2 = ap_create_lock(&spawn_mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, NULL); + if (status1 != APR_SUCCESS || status2 != APR_SUCCESS) { + return NULL; + } permanent_pool = ap_make_sub_pool(NULL, NULL); #ifdef ALLOC_STATS |