From 5aa5f9850dcbe25a11000dffb7bfb793c0764c35 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sun, 7 Dec 2008 06:15:40 +0000 Subject: [PATCH] Make ctx:status an apr_status_t, and be consistent about checking and setting it. Suggested by: Takashi Sato git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@724091 13f79535-47bb-0310-9956-ffa450edef68 --- modules/cluster/mod_heartbeat.c | 10 +++++----- modules/cluster/mod_heartmonitor.c | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/cluster/mod_heartbeat.c b/modules/cluster/mod_heartbeat.c index bb62920cc9..1f978db645 100644 --- a/modules/cluster/mod_heartbeat.c +++ b/modules/cluster/mod_heartbeat.c @@ -34,7 +34,7 @@ typedef struct hb_ctx_t apr_sockaddr_t *mcast_addr; int server_limit; int thread_limit; - int status; + apr_status_t status; volatile int keep_running; apr_proc_mutex_t *mutex; const char *mutex_path; @@ -125,7 +125,7 @@ static void* APR_THREAD_FUNC hb_worker(apr_thread_t *thd, void *data) apr_pool_t *pool = apr_thread_pool_get(thd); apr_pool_tag(pool, "heartbeat_worker"); - ctx->status = 0; + ctx->status = APR_SUCCESS; ctx->keep_running = 1; apr_thread_mutex_unlock(ctx->start_mtx); @@ -218,11 +218,11 @@ static void hb_child_init(apr_pool_t *p, server_rec *s) if (ctx->active) { apr_proc_mutex_child_init(&ctx->mutex, ctx->mutex_path, p); - ctx->status = -1; + ctx->status = APR_EGENERAL; start_hb_worker(p, ctx); - if (ctx->status != 0) { - ap_log_error(APLOG_MARK, APLOG_CRIT, 0, s, + if (ctx->status) { + ap_log_error(APLOG_MARK, APLOG_CRIT, ctx->status, s, "Heartbeat: Failed to start worker thread."); return; } diff --git a/modules/cluster/mod_heartmonitor.c b/modules/cluster/mod_heartmonitor.c index 6d07d95cf3..d54d6e9ca4 100644 --- a/modules/cluster/mod_heartmonitor.c +++ b/modules/cluster/mod_heartmonitor.c @@ -46,7 +46,7 @@ typedef struct hm_ctx_t apr_proc_mutex_t *mutex; const char *mutex_path; apr_sockaddr_t *mcast_addr; - int status; + apr_status_t status; volatile int keep_running; apr_thread_mutex_t *start_mtx; apr_thread_t *thread; @@ -294,7 +294,7 @@ static void* APR_THREAD_FUNC hm_worker(apr_thread_t *thd, void *data) apr_status_t rv; ctx->p = apr_thread_pool_get(thd); - ctx->status = 0; + ctx->status = APR_SUCCESS; ctx->keep_running = 1; apr_thread_mutex_unlock(ctx->start_mtx); @@ -427,12 +427,12 @@ static void hm_child_init(apr_pool_t *p, server_rec *s) "Heartmonitor: Starting Listener Thread. mcast=%pI", ctx->mcast_addr); - ctx->status = -1; + ctx->status = APR_EGENERAL; start_hm_worker(p, ctx); - if (ctx->status != 0) { - ap_log_error(APLOG_MARK, APLOG_CRIT, 0, s, + if (ctx->status) { + ap_log_error(APLOG_MARK, APLOG_CRIT, ctx->status, s, "Heartmonitor: Failed to start listener thread."); return; } -- 2.40.0