summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorJim Jagielski <jim@apache.org>2013-01-09 15:14:42 +0100
committerJim Jagielski <jim@apache.org>2013-01-09 15:14:42 +0100
commitfdce7c3307944da52a49e8c111e13492fe016f55 (patch)
tree9ee56f8dac7d01024d105dad0e663eafdf0d32b9 /modules
parentthese are in 2.4.x (diff)
downloadapache2-fdce7c3307944da52a49e8c111e13492fe016f55.tar.xz
apache2-fdce7c3307944da52a49e8c111e13492fe016f55.zip
Fix mistaken reset of num_free with restored shm
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1430869 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules')
-rw-r--r--modules/slotmem/mod_slotmem_shm.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/slotmem/mod_slotmem_shm.c b/modules/slotmem/mod_slotmem_shm.c
index 3959e93a8e..ec08926450 100644
--- a/modules/slotmem/mod_slotmem_shm.c
+++ b/modules/slotmem/mod_slotmem_shm.c
@@ -296,6 +296,7 @@ static apr_status_t slotmem_create(ap_slotmem_instance_t **new,
{
/* 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_slotmem_instance_t **new,
*/
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_slotmem_instance_t **new,
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;