wrowe 01/07/23 15:19:13
Modified: include apr_pools.h
include/arch/unix inherit.h
memory/unix apr_pools.c
Log:
Depricated the broken apr_pool_child_cleanup_kill, and added the new
apr_pool_child_cleanup_set() to replace the registered child cleanup
with another cleanup fn. Fixed the inherit macro declarations to never
register a NULL cleanup fn.
Revision Changes Path
1.54 +8 -6 apr/include/apr_pools.h
Index: apr_pools.h
===================================================================
RCS file: /home/cvs/apr/include/apr_pools.h,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- apr_pools.h 2001/07/14 22:31:37 1.53
+++ apr_pools.h 2001/07/23 22:19:13 1.54
@@ -381,13 +381,15 @@
apr_status_t (*cleanup)(void *));
/**
- * Remove a previously registered child cleanup function
- * @param p The pool remove the cleanup from
- * @param data The data to remove from cleanup
- * @param cleanup The function to remove from cleanup
+ * Replace the child cleanup of a previously registered cleanup
+ * @param p The pool of the registered cleanup
+ * @param data The data of the registered cleanup
+ * @param plain_cleanup The plain cleanup function of the registered cleanup
+ * @param child_cleanup The function to register as the child cleanup
*/
-APR_DECLARE(void) apr_pool_child_cleanup_kill(apr_pool_t *p, const void
*data,
- apr_status_t (*cleanup) (void
*));
+APR_DECLARE(void) apr_pool_child_cleanup_set(apr_pool_t *p, const void *data,
+ apr_status_t (*plain_cleanup) (void *),
+ apr_status_t (*child_cleanup) (void
*));
/**
* Run the specified cleanup function immediately and unregister it. Use
1.4 +3 -3 apr/include/arch/unix/inherit.h
Index: inherit.h
===================================================================
RCS file: /home/cvs/apr/include/arch/unix/inherit.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- inherit.h 2001/07/18 19:32:29 1.3
+++ inherit.h 2001/07/23 22:19:13 1.4
@@ -64,8 +64,8 @@
{ \
if (!(name->flag & APR_INHERIT)) { \
name->flag |= APR_INHERIT; \
- apr_pool_cleanup_register(name->pool, (void *)name, \
- NULL, cleanup); \
+ apr_pool_cleanup_child_set(name->pool, (void *)name, \
+ cleanup, apr_pool_cleanup_null); \
} \
}
@@ -75,7 +75,7 @@
if (name->flag & APR_INHERIT) { \
name->flag &= ~APR_INHERIT; \
apr_pool_cleanup_kill(name->pool, (void *)name, \
- cleanup); \
+ cleanup, cleanup); \
} \
}
1.102 +8 -6 apr/memory/unix/apr_pools.c
Index: apr_pools.c
===================================================================
RCS file: /home/cvs/apr/memory/unix/apr_pools.c,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -r1.101 -r1.102
--- apr_pools.c 2001/07/14 22:31:38 1.101
+++ apr_pools.c 2001/07/23 22:19:13 1.102
@@ -717,8 +717,9 @@
}
}
-APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data,
- apr_status_t (*cleanup) (void *))
+APR_DECLARE(void) apr_pool_child_cleanup_set(apr_pool_t *p, const void *data,
+ apr_status_t (*plain_cleanup) (void *))
+ apr_status_t (*plain_cleanup) (void *))
{
struct cleanup *c;
struct cleanup **lastp;
@@ -738,8 +739,9 @@
}
}
-APR_DECLARE(void) apr_pool_child_cleanup_kill(apr_pool_t *p, const void
*data,
- apr_status_t (*cleanup) (void *))
+APR_DECLARE(void) apr_pool_child_cleanup_set(apr_pool_t *p, const void *data,
+ apr_status_t (*plain_cleanup) (void
*),
+ apr_status_t (*child_cleanup) (void
*))
{
struct cleanup *c;
struct cleanup **lastp;
@@ -749,8 +751,8 @@
c = p->cleanups;
lastp = &p->cleanups;
while (c) {
- if (c->data == data && c->child_cleanup == cleanup) {
- *lastp = c->next;
+ if (c->data == data && c->plain_cleanup == plain_cleanup) {
+ c->child_cleanup = child_cleanup;
break;
}