apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fua...@apache.org
Subject svn commit: r1484044 - in /apr/apr-util/branches/1.5.x: crypto/apr_crypto.c dbd/apr_dbd.c dbm/apr_dbm.c misc/apu_dso.c
Date Sat, 18 May 2013 02:26:21 GMT
Author: fuankg
Date: Sat May 18 02:26:20 2013
New Revision: 1484044

URL: http://svn.apache.org/r1484044
Log:
Fix forever loop on NetWare when trying to get parent pool.
(Backport of r1479836)

Modified:
    apr/apr-util/branches/1.5.x/crypto/apr_crypto.c
    apr/apr-util/branches/1.5.x/dbd/apr_dbd.c
    apr/apr-util/branches/1.5.x/dbm/apr_dbm.c
    apr/apr-util/branches/1.5.x/misc/apu_dso.c

Modified: apr/apr-util/branches/1.5.x/crypto/apr_crypto.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.5.x/crypto/apr_crypto.c?rev=1484044&r1=1484043&r2=1484044&view=diff
==============================================================================
--- apr/apr-util/branches/1.5.x/crypto/apr_crypto.c (original)
+++ apr/apr-util/branches/1.5.x/crypto/apr_crypto.c Sat May 18 02:26:20 2013
@@ -100,7 +100,9 @@ APU_DECLARE(apr_status_t) apr_crypto_ini
     }
 
     /* Top level pool scope, need process-scope lifetime */
-    for (parent = pool; parent; parent = apr_pool_parent_get(pool))
+    for (parent = apr_pool_parent_get(pool);
+         parent && parent != pool;
+         parent = apr_pool_parent_get(pool))
         pool = parent;
 #if APU_DSO_BUILD
     /* deprecate in 2.0 - permit implicit initialization */

Modified: apr/apr-util/branches/1.5.x/dbd/apr_dbd.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.5.x/dbd/apr_dbd.c?rev=1484044&r1=1484043&r2=1484044&view=diff
==============================================================================
--- apr/apr-util/branches/1.5.x/dbd/apr_dbd.c (original)
+++ apr/apr-util/branches/1.5.x/dbd/apr_dbd.c Sat May 18 02:26:20 2013
@@ -102,8 +102,10 @@ APU_DECLARE(apr_status_t) apr_dbd_init(a
     }
 
     /* Top level pool scope, need process-scope lifetime */
-    for (parent = pool;  parent; parent = apr_pool_parent_get(pool))
-         pool = parent;
+    for (parent = apr_pool_parent_get(pool);
+        parent && parent != pool;
+        parent = apr_pool_parent_get(pool))
+       pool = parent;
 #if APU_DSO_BUILD
     /* deprecate in 2.0 - permit implicit initialization */
     apu_dso_init(pool);

Modified: apr/apr-util/branches/1.5.x/dbm/apr_dbm.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.5.x/dbm/apr_dbm.c?rev=1484044&r1=1484043&r2=1484044&view=diff
==============================================================================
--- apr/apr-util/branches/1.5.x/dbm/apr_dbm.c (original)
+++ apr/apr-util/branches/1.5.x/dbm/apr_dbm.c Sat May 18 02:26:20 2013
@@ -129,8 +129,10 @@ static apr_status_t dbm_open_type(apr_db
         apr_pool_t *parent;
 
         /* Top level pool scope, need process-scope lifetime */
-        for (parent = pool;  parent; parent = apr_pool_parent_get(pool))
-             pool = parent;
+        for (parent = apr_pool_parent_get(pool);
+             parent && parent != pool;
+             parent = apr_pool_parent_get(pool))
+            pool = parent;
 
         /* deprecate in 2.0 - permit implicit initialization */
         apu_dso_init(pool);

Modified: apr/apr-util/branches/1.5.x/misc/apu_dso.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.5.x/misc/apu_dso.c?rev=1484044&r1=1484043&r2=1484044&view=diff
==============================================================================
--- apr/apr-util/branches/1.5.x/misc/apu_dso.c (original)
+++ apr/apr-util/branches/1.5.x/misc/apu_dso.c Sat May 18 02:26:20 2013
@@ -75,7 +75,6 @@ static apr_status_t apu_dso_term(void *p
 apr_status_t apu_dso_init(apr_pool_t *pool)
 {
     apr_status_t ret = APR_SUCCESS;
-    apr_pool_t *global;
     apr_pool_t *parent;
 
     if (apr_atomic_inc32(&initialised)) {
@@ -88,17 +87,19 @@ apr_status_t apu_dso_init(apr_pool_t *po
     }
 
     /* Top level pool scope, need process-scope lifetime */
-    for (parent = global = pool; parent; parent = apr_pool_parent_get(global))
-        global = parent;
+    for (parent = apr_pool_parent_get(pool);
+         parent && parent != pool;
+         parent = apr_pool_parent_get(pool))
+        pool = parent;
 
-    dsos = apr_hash_make(global);
+    dsos = apr_hash_make(pool);
 
 #if APR_HAS_THREADS
-    ret = apr_thread_mutex_create(&mutex, APR_THREAD_MUTEX_DEFAULT, global);
+    ret = apr_thread_mutex_create(&mutex, APR_THREAD_MUTEX_DEFAULT, pool);
     /* This already registers a pool cleanup */
 #endif
 
-    apr_pool_cleanup_register(global, NULL, apu_dso_term,
+    apr_pool_cleanup_register(pool, NULL, apu_dso_term,
                               apr_pool_cleanup_null);
 
     apr_atomic_dec32(&in_init);



Mime
View raw message