]> granicus.if.org Git - apache/commitdiff
Arrange the slotmem chain logic in attach() too.
authorJean-Frederic Clere <jfclere@apache.org>
Mon, 6 Jul 2009 11:39:47 +0000 (11:39 +0000)
committerJean-Frederic Clere <jfclere@apache.org>
Mon, 6 Jul 2009 11:39:47 +0000 (11:39 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@791448 13f79535-47bb-0310-9956-ffa450edef68

modules/slotmem/mod_slotmem_shm.c

index 3b5f326614339cd5f5caf894c3651c20cf3068c5..4100bd49772857d3f039d67e873f2b423fd8bd7a 100644 (file)
@@ -372,15 +372,20 @@ static apr_status_t slotmem_attach(ap_slotmem_instance_t **new,
     }
 
     /* first try to attach to existing slotmem */
-    while (next) {
-        if (strcmp(next->name, fname) == 0) {
-            /* we already have it */
-            *new = next;
-            *item_size = next->desc.size;
-            *item_num = next->desc.num;
-            return APR_SUCCESS;
+    if (next) {
+        for (;;) {
+            if (strcmp(next->name, fname) == 0) {
+                /* we already have it */
+                *new = next;
+                *item_size = next->desc.size;
+                *item_num = next->desc.num;
+                return APR_SUCCESS;
+            }
+            if (!next->next) {
+                 break;
+            }
+            next = next->next;
         }
-        next = next->next;
     }
 
     /* first try to attach to existing shared memory */