summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Querna <pquerna@apache.org>2008-12-05 09:03:57 +0000
committerPaul Querna <pquerna@apache.org>2008-12-05 09:03:57 +0000
commitb23b3ec7f84c3c605dfb8950495b48e41c087dd6 (patch)
tree37ba1e708d61f4db8500c3d5ece22abf42accf7c
parent4a8f5f80c5535ad99834b32581f693cc7c5300c5 (diff)
downloadhttpd-b23b3ec7f84c3c605dfb8950495b48e41c087dd6.tar.gz
Show the correct mutex type (even if its just the enum id) rather than the default one, if it fails.
Suggested by: Ruediger Pluem git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@723666 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--modules/cluster/mod_heartbeat.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/modules/cluster/mod_heartbeat.c b/modules/cluster/mod_heartbeat.c
index 4eac07cffb..9902113fdc 100644
--- a/modules/cluster/mod_heartbeat.c
+++ b/modules/cluster/mod_heartbeat.c
@@ -234,6 +234,7 @@ static void hb_child_init(apr_pool_t *p, server_rec *s)
static int hb_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
server_rec *s)
{
+ apr_lockmech_e mech;
apr_status_t rv;
hb_ctx_t *ctx = ap_get_module_config(s->module_config, &heartbeat_module);
@@ -244,22 +245,24 @@ static int hb_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
return OK;
}
- rv = apr_proc_mutex_create(&ctx->mutex, ctx->mutex_path,
#if APR_HAS_FCNTL_SERIALIZE
- APR_LOCK_FCNTL,
+ mech = APR_LOCK_FCNTL;
#else
#if APR_HAS_FLOCK_SERIALIZE
- APR_LOCK_FLOCK,
+ mech = APR_LOCK_FLOCK;
#else
#error port me to a non crap platform.
#endif
#endif
+
+ rv = apr_proc_mutex_create(&ctx->mutex, ctx->mutex_path,
+ mech,
p);
if (rv) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s,
- "Heartbeat: mutex failed creation at %s (type=%s)",
- ctx->mutex_path, apr_proc_mutex_defname());
+ "Heartbeat: mutex failed creation at %s (type=%d)",
+ ctx->mutex_path, mech);
return !OK;
}