[Pkg-nagios-changes] [pkg-mod-gearman] 43/48: only create dup client if dup server are set

Stig Sandbeck Mathisen ssm at debian.org
Sun Nov 24 22:38:12 UTC 2013


This is an automated email from the git hooks/post-receive script.

ssm pushed a commit to branch master
in repository pkg-mod-gearman.

commit d554fe90c70df273454018498434a36fd5aa6bb0
Author: Sven Nierlein <sven at nierlein.de>
Date:   Fri Nov 15 21:39:04 2013 +0100

    only create dup client if dup server are set
---
 Changes                | 3 +++
 worker/worker_client.c | 8 +++++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/Changes b/Changes
index 3710c7b..9ce54ff 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 This file documents the revision history for mod_gearman.
 
+next:
+          - fixed segfault when dupserver list was empty
+
 1.4.12 Tue Nov  5 10:26:07 CET 2013
           - fixed send_gearman to send duplicate result to normal server (Brian Christiansen)
           - ensure worker are running and doing jobs after reload/sighup
diff --git a/worker/worker_client.c b/worker/worker_client.c
index 584d41d..05ac6e9 100644
--- a/worker/worker_client.c
+++ b/worker/worker_client.c
@@ -83,9 +83,11 @@ void worker_client(int worker_mode, int indx, int shid) {
     }
 
     /* create duplicate client */
-    if ( create_client_dup( mod_gm_opt->dupserver_list, &client_dup ) != GM_OK ) {
-        gm_log( GM_LOG_ERROR, "cannot start client for duplicate server\n" );
-        _exit( EXIT_FAILURE );
+    if( mod_gm_opt->dupserver_num ) {
+        if ( create_client_dup( mod_gm_opt->dupserver_list, &client_dup ) != GM_OK ) {
+            gm_log( GM_LOG_ERROR, "cannot start client for duplicate server\n" );
+            _exit( EXIT_FAILURE );
+        }
     }
 
 #ifdef EMBEDDEDPERL

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-mod-gearman



More information about the Pkg-nagios-changes mailing list