apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r661102 - in /apr/apr-util/branches/1.3.x: CHANGES misc/apr_reslist.c
Date Wed, 28 May 2008 21:45:14 GMT
Author: niq
Date: Wed May 28 14:45:13 2008
New Revision: 661102

URL: http://svn.apache.org/viewvc?rev=661102&view=rev
Log:
Backport r661063 - fix apr_reslist cleanup
Folks on IRC want this backported in time for 1.3.0 roll.

Modified:
    apr/apr-util/branches/1.3.x/CHANGES
    apr/apr-util/branches/1.3.x/misc/apr_reslist.c

Modified: apr/apr-util/branches/1.3.x/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.3.x/CHANGES?rev=661102&r1=661101&r2=661102&view=diff
==============================================================================
--- apr/apr-util/branches/1.3.x/CHANGES [utf-8] (original)
+++ apr/apr-util/branches/1.3.x/CHANGES [utf-8] Wed May 28 14:45:13 2008
@@ -1,6 +1,9 @@
                                                      -*- coding: utf-8 -*-
 Changes with APR-util 1.3.0
 
+  *) apr_reslist: destroy all resources in apr_cleanup (don't give up on error).
+     PR 45086 [Nick Kew]
+
   *) Add apr_brigade_split_ex for reusing existing brigades in situation where
      brigades need to be split often during the lifetime of a pool.
      [Ruediger Pluem]

Modified: apr/apr-util/branches/1.3.x/misc/apr_reslist.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.3.x/misc/apr_reslist.c?rev=661102&r1=661101&r2=661102&view=diff
==============================================================================
--- apr/apr-util/branches/1.3.x/misc/apr_reslist.c (original)
+++ apr/apr-util/branches/1.3.x/misc/apr_reslist.c Wed May 28 14:45:13 2008
@@ -137,18 +137,20 @@
 
 static apr_status_t reslist_cleanup(void *data_)
 {
-    apr_status_t rv;
+    apr_status_t rv = APR_SUCCESS;
     apr_reslist_t *rl = data_;
     apr_res_t *res;
 
     apr_thread_mutex_lock(rl->listlock);
 
     while (rl->nidle > 0) {
+        apr_status_t rv1;
         res = pop_resource(rl);
         rl->ntotal--;
-        rv = destroy_resource(rl, res);
-        if (rv != APR_SUCCESS) {
-            return rv;
+        rv1 = destroy_resource(rl, res);
+        if (rv1 != APR_SUCCESS) {
+            rv = rv1;  /* loses info in the unlikely event of
+                        * multiple *different* failures */
         }
         free_container(rl, res);
     }
@@ -159,7 +161,7 @@
     apr_thread_mutex_destroy(rl->listlock);
     apr_thread_cond_destroy(rl->avail);
 
-    return APR_SUCCESS;
+    return rv;
 }
 
 /**



Mime
View raw message