diff options
author | ylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68> | 2022-01-24 14:18:04 +0000 |
---|---|---|
committer | ylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68> | 2022-01-24 14:18:04 +0000 |
commit | 4567909f4a99a3fb3e983cc8847de620d4952954 (patch) | |
tree | 0b4df3c2954656f6dab48b2e15b487d3893549a5 | |
parent | b156be5476d0023476fee17f618b3b11cea5aefe (diff) | |
download | libapr-4567909f4a99a3fb3e983cc8847de620d4952954.tar.gz |
apr_thread: Follow up to r1897179: abort_fn on apr_allocator_create() failure.
Merge r1897419 from trunk.
Submitted by: ylavic
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.8.x@1897420 13f79535-47bb-0310-9956-ffa450edef68
-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 c65b5e23a..96789f604 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -92,6 +92,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; @@ -103,10 +104,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 698704476..d626ce133 100644 --- a/threadproc/netware/thread.c +++ b/threadproc/netware/thread.c @@ -94,6 +94,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; @@ -105,10 +106,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 694497683..52afed3ff 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -97,6 +97,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; @@ -108,10 +109,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 bb1db1e80..d4f13d964 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -166,6 +166,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; @@ -177,10 +178,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 0ed485642..4a6741a72 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -103,6 +103,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; @@ -114,10 +115,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; |