diff options
author | Yann Ylavic <ylavic@apache.org> | 2022-01-24 14:16:04 +0000 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2022-01-24 14:16:04 +0000 |
commit | 3c0a292ceeabd8a58a984b3279097f033b44659c (patch) | |
tree | f5d9d63d4610bad63d8ff6756bbce6e974ce9f64 /threadproc | |
parent | d77a576daf76df4ea5c175ea156ade0ed7f844f1 (diff) | |
download | apr-3c0a292ceeabd8a58a984b3279097f033b44659c.tar.gz |
apr_thread: Follow up to r1897179: abort_fn on apr_allocator_create() failure.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1897419 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'threadproc')
-rw-r--r-- | threadproc/beos/thread.c | 6 | ||||
-rw-r--r-- | threadproc/netware/thread.c | 6 | ||||
-rw-r--r-- | threadproc/os2/thread.c | 6 | ||||
-rw-r--r-- | threadproc/unix/thread.c | 6 | ||||
-rw-r--r-- | threadproc/win32/thread.c | 6 |
5 files changed, 20 insertions, 10 deletions
diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index 6a3e05806..501678373 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -93,6 +93,7 @@ static apr_status_t alloc_thread(apr_thread_t **new, apr_pool_t *pool) { apr_status_t stat; + apr_abortfunc_t abort_fn = apr_pool_abort_get(pool); apr_allocator_t *allocator; apr_pool_t *p; @@ -104,10 +105,11 @@ static apr_status_t alloc_thread(apr_thread_t **new, */ stat = apr_allocator_create(&allocator); if (stat != APR_SUCCESS) { + if (abort_fn) + abort_fn(stat); return stat; } - stat = apr_pool_create_unmanaged_ex(&p, apr_pool_abort_get(pool), - allocator); + stat = apr_pool_create_unmanaged_ex(&p, abort_fn, allocator); if (stat != APR_SUCCESS) { apr_allocator_destroy(allocator); return stat; diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c index 993d2c60d..86213a01f 100644 --- a/threadproc/netware/thread.c +++ b/threadproc/netware/thread.c @@ -95,6 +95,7 @@ static apr_status_t alloc_thread(apr_thread_t **new, apr_pool_t *pool) { apr_status_t stat; + apr_abortfunc_t abort_fn = apr_pool_abort_get(pool); apr_allocator_t *allocator; apr_pool_t *p; @@ -106,10 +107,11 @@ static apr_status_t alloc_thread(apr_thread_t **new, */ stat = apr_allocator_create(&allocator); if (stat != APR_SUCCESS) { + if (abort_fn) + abort_fn(stat); return stat; } - stat = apr_pool_create_unmanaged_ex(&p, apr_pool_abort_get(pool), - allocator); + stat = apr_pool_create_unmanaged_ex(&p, abort_fn, allocator); if (stat != APR_SUCCESS) { apr_allocator_destroy(allocator); return stat; diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index ffb663e90..bcb3d7b20 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -98,6 +98,7 @@ static apr_status_t alloc_thread(apr_thread_t **new, apr_pool_t *pool) { apr_status_t stat; + apr_abortfunc_t abort_fn = apr_pool_abort_get(pool); apr_allocator_t *allocator; apr_pool_t *p; @@ -109,10 +110,11 @@ static apr_status_t alloc_thread(apr_thread_t **new, */ stat = apr_allocator_create(&allocator); if (stat != APR_SUCCESS) { + if (abort_fn) + abort_fn(stat); return stat; } - stat = apr_pool_create_unmanaged_ex(&p, apr_pool_abort_get(pool), - allocator); + stat = apr_pool_create_unmanaged_ex(&p, abort_fn, allocator); if (stat != APR_SUCCESS) { apr_allocator_destroy(allocator); return stat; diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index eccda7f40..2b255252c 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -167,6 +167,7 @@ static apr_status_t alloc_thread(apr_thread_t **new, apr_pool_t *pool) { apr_status_t stat; + apr_abortfunc_t abort_fn = apr_pool_abort_get(pool); apr_allocator_t *allocator; apr_pool_t *p; @@ -178,10 +179,11 @@ static apr_status_t alloc_thread(apr_thread_t **new, */ stat = apr_allocator_create(&allocator); if (stat != APR_SUCCESS) { + if (abort_fn) + abort_fn(stat); return stat; } - stat = apr_pool_create_unmanaged_ex(&p, apr_pool_abort_get(pool), - allocator); + stat = apr_pool_create_unmanaged_ex(&p, abort_fn, allocator); if (stat != APR_SUCCESS) { apr_allocator_destroy(allocator); return stat; diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 3d0cd535b..281a44ac6 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -104,6 +104,7 @@ static apr_status_t alloc_thread(apr_thread_t **new, apr_pool_t *pool) { apr_status_t stat; + apr_abortfunc_t abort_fn = apr_pool_abort_get(pool); apr_allocator_t *allocator; apr_pool_t *p; @@ -115,10 +116,11 @@ static apr_status_t alloc_thread(apr_thread_t **new, */ stat = apr_allocator_create(&allocator); if (stat != APR_SUCCESS) { + if (abort_fn) + abort_fn(stat); return stat; } - stat = apr_pool_create_unmanaged_ex(&p, apr_pool_abort_get(pool), - allocator); + stat = apr_pool_create_unmanaged_ex(&p, abort_fn, allocator); if (stat != APR_SUCCESS) { apr_allocator_destroy(allocator); return stat; |