httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jfcl...@apache.org
Subject svn commit: r791448 - /httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c
Date Mon, 06 Jul 2009 11:39:47 GMT
Author: jfclere
Date: Mon Jul  6 11:39:47 2009
New Revision: 791448

URL: http://svn.apache.org/viewvc?rev=791448&view=rev
Log:
Arrange the slotmem chain logic in attach() too.

Modified:
    httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c

Modified: httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c?rev=791448&r1=791447&r2=791448&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c (original)
+++ httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c Mon Jul  6 11:39:47 2009
@@ -372,15 +372,20 @@
     }
 
     /* 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 */



Mime
View raw message