diff options
-rw-r--r-- | CHANGES | 5 | ||||
-rw-r--r-- | STATUS | 6 | ||||
-rw-r--r-- | dso/aix/dso.c | 9 | ||||
-rw-r--r-- | dso/beos/dso.c | 9 | ||||
-rw-r--r-- | dso/unix/dso.c | 9 | ||||
-rw-r--r-- | dso/win32/dso.c | 9 |
6 files changed, 42 insertions, 5 deletions
@@ -1,5 +1,10 @@ Changes with APR b1 + *) All dso implementations now register a cleanup to unload the DSO + when it is loaded. If the pool is removed, we really do need to + remove the DSO. In the past, different platforms behaved differently + it this respect. [Ryan Bloom] + *) Add linkage declarations to the DSO code. [Gregory Nicholls <gnicholls@level8.com>] @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/01/19 03:08:40 $] +Last modified at [$Date: 2001/01/19 03:13:00 $] Release: @@ -57,10 +57,6 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: located in libc, libcrypt, or libufc) Status: Greg +1 (volunteers) - * apr_dso_load() should (uniformly) add a cleanup to unload the DSO. - Currently, the per-platform DSO loading is inconsistent in this - regard. - * apr_create_lock() changes: - It ignores the "type" parameter, so toss it. - The fname param is allowed to be NULL on the Unix platform. diff --git a/dso/aix/dso.c b/dso/aix/dso.c index cd63af0b1..98425c6c1 100644 --- a/dso/aix/dso.c +++ b/dso/aix/dso.c @@ -132,6 +132,12 @@ struct dl_info { * add the basic "wrappers" here. */ +static apr_status_t dso_cleanup(void *thedso) +{ + apr_dso_handle_t *dso = thedso; + return apr_dso_unload(dso); +} + APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) { @@ -143,6 +149,9 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); (*res_handle)->handle = (void*)os_handle; (*res_handle)->cont = ctx; + + apr_register_cleanup(ctx, *res_handle, dso_cleanup, apr_null_cleanup); + return APR_SUCCESS; } diff --git a/dso/beos/dso.c b/dso/beos/dso.c index bb01d858c..4306db765 100644 --- a/dso/beos/dso.c +++ b/dso/beos/dso.c @@ -56,6 +56,12 @@ #if APR_HAS_DSO +static apr_status_t dso_cleanup(void *thedso) +{ + apr_dso_handle_t *dso = thedso; + return apr_dso_unload(dso); +} + APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) { @@ -67,6 +73,9 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); (*res_handle)->handle = newid; (*res_handle)->cont = ctx; + + apr_register_cleanup(ctx, *res_handle, dso_cleanup, apr_null_cleanup); + return APR_SUCCESS; } diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 154a11fb0..ada9c314f 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -61,6 +61,12 @@ #include <stddef.h> #endif +static apr_status_t dso_cleanup(void *thedso) +{ + apr_dso_handle_t *dso = thedso; + return apr_dso_unload(dso); +} + APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) { @@ -88,6 +94,9 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, (*res_handle)->handle = (void*)os_handle; (*res_handle)->cont = ctx; (*res_handle)->errormsg = NULL; + + apr_register_cleanup(ctx, *res_handle, dso_cleanup, apr_null_cleanup); + return APR_SUCCESS; } diff --git a/dso/win32/dso.c b/dso/win32/dso.c index 3899fa223..a2ba47ddb 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -59,6 +59,12 @@ #if APR_HAS_DSO +static apr_status_t dso_cleanup(void *thedso) +{ + apr_dso_handle_t *dso = thedso; + return apr_dso_unload(dso); +} + APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) { @@ -111,6 +117,9 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, (*res_handle)->handle = (void*)os_handle; (*res_handle)->cont = ctx; (*res_handle)->load_error = APR_SUCCESS; + + apr_register_cleanup(ctx, *res_handle, dso_cleanup, apr_null_cleanup); + return APR_SUCCESS; } |