httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1430869 - /httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c
Date Wed, 09 Jan 2013 14:14:42 GMT
Author: jim
Date: Wed Jan  9 14:14:42 2013
New Revision: 1430869

URL: http://svn.apache.org/viewvc?rev=1430869&view=rev
Log:
Fix mistaken reset of num_free with restored shm

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=1430869&r1=1430868&r2=1430869&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c (original)
+++ httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c Wed Jan  9 14:14:42 2013
@@ -296,6 +296,7 @@ static apr_status_t slotmem_create(ap_sl
 {
 /*    void *slotmem = NULL; */
     int fbased = 1;
+    int restored = 0;
     char *ptr;
     sharedslotdesc_t desc;
     ap_slotmem_instance_t *res;
@@ -390,6 +391,7 @@ static apr_status_t slotmem_create(ap_sl
          */
         if (type & AP_SLOTMEM_TYPE_PERSIST) {
             restore_slotmem(ptr, fname, dsize, pool);
+            restored = 1;
         }
     }
 
@@ -400,7 +402,9 @@ static apr_status_t slotmem_create(ap_sl
     res->fbased = fbased;
     res->shm = shm;
     res->num_free = (unsigned int *)ptr;
-    *res->num_free = item_num;
+    if (!restored) {
+        *res->num_free = item_num;
+    }
     res->persist = (void *)ptr;
     ptr += AP_UNSIGNEDINT_OFFSET;
     res->base = (void *)ptr;



Mime
View raw message