You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by rb...@apache.org on 2001/01/19 04:13:02 UTC

cvs commit: apr/dso/win32 dso.c

rbb         01/01/18 19:13:02

  Modified:    .        CHANGES STATUS
               dso/aix  dso.c
               dso/beos dso.c
               dso/unix dso.c
               dso/win32 dso.c
  Log:
  All platforms now register a cleanup when a DSO is loaded.  This just
  makes a practice uniform across all platforms.  In the past, this was
  done differently on different platforms.
  
  Revision  Changes    Path
  1.42      +5 -0      apr/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apr/CHANGES,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- CHANGES	2001/01/12 04:50:30	1.41
  +++ CHANGES	2001/01/19 03:13:00	1.42
  @@ -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 <gn...@level8.com>]
   
  
  
  
  1.25      +1 -5      apr/STATUS
  
  Index: STATUS
  ===================================================================
  RCS file: /home/cvs/apr/STATUS,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- STATUS	2001/01/19 03:08:40	1.24
  +++ STATUS	2001/01/19 03:13:00	1.25
  @@ -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:
   
  @@ -56,10 +56,6 @@
         crypt() function is available, and a way to call it (whether it is
         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.
  
  
  
  1.10      +9 -0      apr/dso/aix/dso.c
  
  Index: dso.c
  ===================================================================
  RCS file: /home/cvs/apr/dso/aix/dso.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- dso.c	2001/01/12 04:50:30	1.9
  +++ dso.c	2001/01/19 03:13:01	1.10
  @@ -132,6 +132,12 @@
    * 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 @@
       *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;
   }
   
  
  
  
  1.13      +9 -0      apr/dso/beos/dso.c
  
  Index: dso.c
  ===================================================================
  RCS file: /home/cvs/apr/dso/beos/dso.c,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- dso.c	2001/01/12 04:50:30	1.12
  +++ dso.c	2001/01/19 03:13:01	1.13
  @@ -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 @@
       *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;
   }
   
  
  
  
  1.29      +9 -0      apr/dso/unix/dso.c
  
  Index: dso.c
  ===================================================================
  RCS file: /home/cvs/apr/dso/unix/dso.c,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- dso.c	2001/01/12 04:50:31	1.28
  +++ dso.c	2001/01/19 03:13:01	1.29
  @@ -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 @@
       (*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;
   }
       
  
  
  
  1.16      +9 -0      apr/dso/win32/dso.c
  
  Index: dso.c
  ===================================================================
  RCS file: /home/cvs/apr/dso/win32/dso.c,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- dso.c	2001/01/12 04:50:31	1.15
  +++ dso.c	2001/01/19 03:13:02	1.16
  @@ -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 @@
       (*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;
   }