summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Jagielski <jim@apache.org>2012-03-08 16:40:42 +0100
committerJim Jagielski <jim@apache.org>2012-03-08 16:40:42 +0100
commite7fdd879a7da6b6e8555f5bde069ac2b2cd863b7 (patch)
tree66ec97c6ad845844eeae9ed6be4af14a3d642510
parentBump (diff)
downloadapache2-e7fdd879a7da6b6e8555f5bde069ac2b2cd863b7.tar.xz
apache2-e7fdd879a7da6b6e8555f5bde069ac2b2cd863b7.zip
Use new ap_runtime_dir_relative() API
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1298433 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--docs/log-message-tags/next-number2
-rw-r--r--modules/slotmem/mod_slotmem_shm.c30
2 files changed, 22 insertions, 10 deletions
diff --git a/docs/log-message-tags/next-number b/docs/log-message-tags/next-number
index 0c80f59274..c801f0a47c 100644
--- a/docs/log-message-tags/next-number
+++ b/docs/log-message-tags/next-number
@@ -1 +1 @@
-2300
+2304
diff --git a/modules/slotmem/mod_slotmem_shm.c b/modules/slotmem/mod_slotmem_shm.c
index b3a5ddcbe0..a9b7ca258c 100644
--- a/modules/slotmem/mod_slotmem_shm.c
+++ b/modules/slotmem/mod_slotmem_shm.c
@@ -69,7 +69,6 @@ struct ap_slotmem_instance_t {
struct ap_slotmem_instance_t *next; /* location of next allocated segment */
};
-
/*
* Memory layout:
* sharedslotdesc_t | num_free | slots | isuse array |
@@ -82,6 +81,9 @@ struct ap_slotmem_instance_t {
static struct ap_slotmem_instance_t *globallistmem = NULL;
static apr_pool_t *gpool = NULL;
+#define DEFAULT_SLOTMEM_PREFIX "slotmem-shm-"
+#define DEFAULT_SLOTMEM_SUFFIX ".shm"
+
/* apr:shmem/unix/shm.c */
static apr_status_t unixd_set_shm_perms(const char *fname)
{
@@ -125,10 +127,6 @@ static apr_status_t unixd_set_shm_perms(const char *fname)
*
*/
-#define DEFAULT_SLOTMEM_PREFIX DEFAULT_REL_RUNTIMEDIR "/slotmem-shm-"
-
-#define DEFAULT_SLOTMEM_SUFFIX ".shm"
-
static const char *slotmem_filename(apr_pool_t *pool, const char *slotmemname)
{
const char *fname;
@@ -136,9 +134,9 @@ static const char *slotmem_filename(apr_pool_t *pool, const char *slotmemname)
return NULL;
}
else if (slotmemname[0] != '/') {
- const char *path = apr_pstrcat(pool, DEFAULT_SLOTMEM_PREFIX, slotmemname,
- DEFAULT_SLOTMEM_SUFFIX, NULL);
- fname = ap_server_root_relative(pool, path);
+ const char *filenm = apr_pstrcat(pool, DEFAULT_SLOTMEM_PREFIX,
+ slotmemname, DEFAULT_SLOTMEM_SUFFIX, NULL);
+ fname = ap_runtime_dir_relative(pool, filenm);
}
else {
fname = slotmemname;
@@ -297,6 +295,9 @@ static apr_status_t slotmem_create(ap_slotmem_instance_t **new,
}
/* first try to attach to existing shared memory */
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, APLOGNO(02300)
+ "create %s: %"APR_SIZE_T_FMT"/%u", fname, item_size,
+ item_num);
if (fbased) {
rv = apr_shm_attach(&shm, fname, gpool);
}
@@ -401,6 +402,9 @@ static apr_status_t slotmem_attach(ap_slotmem_instance_t **new,
return APR_ENOSHMAVAIL;
}
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, APLOGNO(02301)
+ "attach looking for %s", fname);
+
/* first try to attach to existing slotmem */
if (next) {
for (;;) {
@@ -409,6 +413,10 @@ static apr_status_t slotmem_attach(ap_slotmem_instance_t **new,
*new = next;
*item_size = next->desc.size;
*item_num = next->desc.num;
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf,
+ APLOGNO(02302)
+ "attach found %s: %"APR_SIZE_T_FMT"/%u", fname,
+ *item_size, *item_num);
return APR_SUCCESS;
}
if (!next->next) {
@@ -418,7 +426,7 @@ static apr_status_t slotmem_attach(ap_slotmem_instance_t **new,
}
}
- /* first try to attach to existing shared memory */
+ /* next try to attach to existing shared memory */
rv = apr_shm_attach(&shm, fname, gpool);
if (rv != APR_SUCCESS) {
return rv;
@@ -453,6 +461,10 @@ static apr_status_t slotmem_attach(ap_slotmem_instance_t **new,
*new = res;
*item_size = desc.size;
*item_num = desc.num;
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf,
+ APLOGNO(02303)
+ "attach found %s: %"APR_SIZE_T_FMT"/%u", fname,
+ *item_size, *item_num);
return APR_SUCCESS;
}