]> granicus.if.org Git - apache/commitdiff
mod_slotmem_shm: follow up to r1702450.
authorYann Ylavic <ylavic@apache.org>
Fri, 11 Sep 2015 15:30:16 +0000 (15:30 +0000)
committerYann Ylavic <ylavic@apache.org>
Fri, 11 Sep 2015 15:30:16 +0000 (15:30 +0000)
Use the generation number from the MPM (AP_MPMQ_GENERATION) since
AP_SQ_CONFIG_GEN is irrelevent in non-forked MPMs children.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1702501 13f79535-47bb-0310-9956-ffa450edef68

modules/slotmem/mod_slotmem_shm.c

index c880e5c87ef445594a293053c6b21f6635cca8ff..d969b68878fde191faa3125214355ab8c96d14e2 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "httpd.h"
 #include "http_main.h"
+#include "ap_mpm.h" /* for ap_mpm_query() */
 
 #define AP_SLOTMEM_IS_PREGRAB(t)    (t->desc.type & AP_SLOTMEM_TYPE_PREGRAB)
 #define AP_SLOTMEM_IS_PERSIST(t)    (t->desc.type & AP_SLOTMEM_TYPE_PERSIST)
@@ -119,9 +120,12 @@ static int slotmem_filenames(apr_pool_t *pool,
                             NULL);
 #else
         /* Each generation needs its own file name. */
-        fname = apr_psprintf(pool, "%s%s_%x%s", DEFAULT_SLOTMEM_PREFIX,
-                             fname, ap_state_query(AP_SQ_CONFIG_GEN),
-                             DEFAULT_SLOTMEM_SUFFIX);
+        {
+            int generation = 0;
+            ap_mpm_query(AP_MPMQ_GENERATION, &generation);
+            fname = apr_psprintf(pool, "%s%s_%x%s", DEFAULT_SLOTMEM_PREFIX,
+                                 fname, generation, DEFAULT_SLOTMEM_SUFFIX);
+        }
 #endif
         fname = ap_runtime_dir_relative(pool, fname);