From cvs-return-1694-apmail-apr-cvs-archive=apr.apache.org@apr.apache.org Mon Jul 23 22:21:41 2001 Return-Path: Delivered-To: apmail-apr-cvs-archive@apr.apache.org Received: (qmail 53154 invoked by uid 500); 23 Jul 2001 22:21:41 -0000 Mailing-List: contact cvs-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: dev@apr.apache.org Delivered-To: mailing list cvs@apr.apache.org Received: (qmail 53133 invoked from network); 23 Jul 2001 22:21:40 -0000 Date: 23 Jul 2001 22:19:13 -0000 Message-ID: <20010723221913.11298.qmail@icarus.apache.org> From: wrowe@apache.org To: apr-cvs@apache.org Subject: cvs commit: apr/memory/unix apr_pools.c X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N 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; }