From cd29301c60cadca77918d11c2f2a1e860a7c9d9e Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 15 May 2009 15:16:16 +0000 Subject: [PATCH] compile-time issues git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@775186 13f79535-47bb-0310-9956-ffa450edef68 --- include/ap_slotmem.h | 5 +++++ modules/slotmem/mod_slotmem_plain.c | 2 +- modules/slotmem/mod_slotmem_shm.c | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/ap_slotmem.h b/include/ap_slotmem.h index 219556e179..e066e773d2 100644 --- a/include/ap_slotmem.h +++ b/include/ap_slotmem.h @@ -57,6 +57,9 @@ extern "C" { typedef unsigned int ap_slotmem_type_t; +#define AP_SLOTMEM_TYPE_PERSIST (1 << 0) +#define AP_SLOTMEM_TYPE_NOTMPSAFE (1 << 1) + typedef struct ap_slotmem_instance_t ap_slotmem_instance_t; /** @@ -143,6 +146,8 @@ struct ap_slotmem_provider_t { apr_size_t (* slot_size)(ap_slotmem_instance_t *s); }; +typedef struct ap_slotmem_provider_t ap_slotmem_provider_t; + #ifdef __cplusplus } #endif diff --git a/modules/slotmem/mod_slotmem_plain.c b/modules/slotmem/mod_slotmem_plain.c index c4e793891f..4cd7fbcf28 100644 --- a/modules/slotmem/mod_slotmem_plain.c +++ b/modules/slotmem/mod_slotmem_plain.c @@ -201,7 +201,7 @@ static int pre_config(apr_pool_t *p, apr_pool_t *plog, static void ap_plainmem_register_hook(apr_pool_t *p) { /* XXX: static const char * const prePos[] = { "mod_slotmem.c", NULL }; */ - ap_register_provider(p, AP_SLOTMEM_STORAGE, "plain", "0", &storage); + ap_register_provider(p, AP_SLOTMEM_PROVIDER_GROUP, "plain", "0", &storage); ap_hook_pre_config(pre_config, NULL, NULL, APR_HOOK_MIDDLE); } diff --git a/modules/slotmem/mod_slotmem_shm.c b/modules/slotmem/mod_slotmem_shm.c index fc7c1824c5..ae12b8c913 100644 --- a/modules/slotmem/mod_slotmem_shm.c +++ b/modules/slotmem/mod_slotmem_shm.c @@ -317,7 +317,7 @@ static apr_status_t slotmem_create(ap_slotmem_instance_t **new, const char *name memcpy(ptr, &desc, sizeof(desc)); ptr = ptr + sizeof(desc); memset(ptr, 0, dsize); - if (type == SLOTMEM_PERSIST) + if (type & AP_SLOTMEM_TYPE_PERSIST) restore_slotmem(ptr, fname, dsize, pool); } @@ -675,7 +675,7 @@ static void child_init(apr_pool_t *p, server_rec *s) static void ap_sharedmem_register_hook(apr_pool_t *p) { const ap_slotmem_provider_t *storage = sharedmem_getstorage(); - ap_register_provider(p, AP_SLOTMEM_STORAGE, "shared", "0", storage); + ap_register_provider(p, AP_SLOTMEM_PROVIDER_GROUP, "shared", "0", storage); ap_hook_post_config(post_config, NULL, NULL, APR_HOOK_LAST); ap_hook_pre_config(pre_config, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_child_init(child_init, NULL, NULL, APR_HOOK_MIDDLE); -- 2.50.1