[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: rev 3701 - trunk/subversion/libsvn_subr

From: Justin Erenkrantz <jerenkrantz_at_apache.org>
Date: 2002-11-09 11:24:55 CET

--On Saturday, November 9, 2002 2:19 AM -0800 Justin Erenkrantz
<jerenkrantz@apache.org> wrote:

> P.S. Hopefully, my mailer doesn't munge this patch. If it seems
> that it does, I'll resend...

Hmm. Attempt two using another way to send the patch. Sorry, I've
got to figure out how to get patches across without munging. --
justin

Index: subversion/libsvn_wc/lock.c
===================================================================
--- subversion/libsvn_wc/lock.c (revision 3707)
+++ subversion/libsvn_wc/lock.c (working copy)
@@ -74,7 +74,8 @@

 
 static svn_error_t *
-do_close (svn_wc_adm_access_t *adm_access, svn_boolean_t
preserve_lock);
+do_close (svn_wc_adm_access_t *adm_access, apr_pool_t *pool,
+ svn_boolean_t preserve_lock);

 /* Create a physical lock file in the admin directory for
ADM_ACCESS. Wait
    up to WAIT_FOR seconds if the lock already exists retrying every
@@ -132,10 +133,13 @@
   svn_wc_adm_access_t *lock = p;
   svn_boolean_t cleanup;
   svn_error_t *err;
+ apr_pool_t *parent_pool;

- err = svn_wc__adm_is_cleanup_required (&cleanup, lock, lock->pool);
+ parent_pool = apr_pool_parent_get(lock->pool);
+
+ err = svn_wc__adm_is_cleanup_required (&cleanup, lock,
parent_pool);
   if (!err)
- err = do_close (lock, cleanup);
+ err = do_close (lock, parent_pool, cleanup);

   /* ### Is this the correct way to handle the error? */
   if (err)
@@ -173,7 +177,7 @@
   lock->lock_exists = FALSE;
   lock->set_owner = FALSE;
   lock->path = apr_pstrdup (pool, path);
- lock->pool = pool;
+ apr_pool_create(&lock->pool, pool);

   apr_pool_cleanup_register (lock->pool, lock, pool_cleanup,
                              pool_cleanup_child);
@@ -437,6 +441,7 @@
  */
 static svn_error_t *
 do_close (svn_wc_adm_access_t *adm_access,
+ apr_pool_t *pool,
           svn_boolean_t preserve_lock)
 {
   apr_hash_index_t *hi;
@@ -453,10 +458,10 @@
          it is allowed but unpredictable! So, first loop to
identify and
          copy direct descendents, second loop to close them. */
       int i;
- apr_array_header_t *children = apr_array_make
(adm_access->pool, 1,
+ apr_array_header_t *children = apr_array_make (pool, 1,
                                                      sizeof
(adm_access));

- for (hi = apr_hash_first (adm_access->pool, adm_access->set);
+ for (hi = apr_hash_first (pool, adm_access->set);
            hi;
            hi = apr_hash_next (hi))
         {
@@ -465,8 +470,7 @@
           const char *name;
           apr_hash_this (hi, NULL, NULL, &val);
           associated = val;
- name = svn_path_is_child (adm_access->path,
associated->path,
- adm_access->pool);
+ name = svn_path_is_child (adm_access->path,
associated->path, pool);
           if (name && svn_path_is_single_path_component (name))
             {
               *(svn_wc_adm_access_t**)apr_array_push (children) =
associated;
@@ -479,7 +483,7 @@
         {
           svn_wc_adm_access_t *child = APR_ARRAY_IDX(children, i,
 
svn_wc_adm_access_t*);
- SVN_ERR (do_close (child, preserve_lock));
+ SVN_ERR (do_close (child, pool, preserve_lock));
         }
     }

@@ -488,7 +492,7 @@
     {
       if (adm_access->lock_exists && ! preserve_lock)
         {
- SVN_ERR (remove_lock (adm_access->path, adm_access->pool));
+ SVN_ERR (remove_lock (adm_access->path, pool));
           adm_access->lock_exists = FALSE;
         }
       /* Reset to prevent further use of the write lock. */
@@ -510,7 +514,7 @@
 svn_error_t *
 svn_wc_adm_close (svn_wc_adm_access_t *adm_access)
 {
- return do_close (adm_access, FALSE);
+ return do_close (adm_access, adm_access->pool, FALSE);
 }

 svn_error_t *

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Nov 9 11:24:41 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.