You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by pq...@apache.org on 2008/12/07 07:15:41 UTC

svn commit: r724091 - in /httpd/httpd/trunk/modules/cluster: mod_heartbeat.c mod_heartmonitor.c

Author: pquerna
Date: Sat Dec  6 22:15:40 2008
New Revision: 724091

URL: http://svn.apache.org/viewvc?rev=724091&view=rev
Log:
Make ctx:status an apr_status_t, and be consistent about checking and setting it.
Suggested by: Takashi Sato <takashi lans-tv.com>

Modified:
    httpd/httpd/trunk/modules/cluster/mod_heartbeat.c
    httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c

Modified: httpd/httpd/trunk/modules/cluster/mod_heartbeat.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cluster/mod_heartbeat.c?rev=724091&r1=724090&r2=724091&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cluster/mod_heartbeat.c (original)
+++ httpd/httpd/trunk/modules/cluster/mod_heartbeat.c Sat Dec  6 22:15:40 2008
@@ -34,7 +34,7 @@
     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 @@
 
     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 @@
     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;
         }

Modified: httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c?rev=724091&r1=724090&r2=724091&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c (original)
+++ httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c Sat Dec  6 22:15:40 2008
@@ -46,7 +46,7 @@
     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 @@
     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 @@
                  "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;
     }