[Pkg-nagios-changes] [SCM] Debian packaging for mod gearman. branch, master, updated. f5edd3e88aa2138dcf6d044c835fbd0ada944168

Sven Nierlein sven at nierlein.org
Fri Feb 11 11:18:39 UTC 2011


The following commit has been merged in the master branch:
commit 6acf60c9562598ee77998f586993754719f15cdf
Author: Sven Nierlein <sven at nierlein.org>
Date:   Wed Feb 2 00:49:27 2011 +0100

    added error message when using unknown option

diff --git a/Changes b/Changes
index f149746..c7dd53b 100644
--- a/Changes
+++ b/Changes
@@ -3,6 +3,8 @@ This file documents the revision history for mod_gearman.
 1.0    Sun...
           - added stderr to send_multi
           - added missing performance data to send_multi
+          - added error message when using unknown option
+          - fixed handling of unusual exit codes
 
 0.9    Sun Jan 16 21:20:06 CET 2011
           - prepared debian packaging (thanks Stig Sandbeck Mathisen)
diff --git a/common/utils.c b/common/utils.c
index f70a319..9a7c862 100644
--- a/common/utils.c
+++ b/common/utils.c
@@ -299,24 +299,28 @@ int parse_args_line(mod_gm_opt_t *opt, char * arg, int recursion_level) {
     /* daemon mode */
     if ( !strcmp( key, "daemon" ) ||  !strcmp( key, "d" ) ) {
         opt->daemon_mode = parse_yes_or_no(value, GM_ENABLED);
+        return(GM_OK);
     }
 
     /* perfdata */
     else if (   !strcmp( key, "perfdata" ) ) {
         opt->set_queues_by_hand++;
         opt->perfdata = parse_yes_or_no(value, GM_ENABLED);
+        return(GM_OK);
     }
 
     /* hosts */
     else if ( !strcmp( key, "hosts" ) ) {
         opt->set_queues_by_hand++;
         opt->hosts = parse_yes_or_no(value, GM_ENABLED);
+        return(GM_OK);
     }
 
     /* services */
     else if ( !strcmp( key, "services" ) ) {
         opt->set_queues_by_hand++;
         opt->services = parse_yes_or_no(value, GM_ENABLED);
+        return(GM_OK);
     }
 
     /* eventhandler */
@@ -325,26 +329,35 @@ int parse_args_line(mod_gm_opt_t *opt, char * arg, int recursion_level) {
             ) {
         opt->set_queues_by_hand++;
         opt->events = parse_yes_or_no(value, GM_ENABLED);
+        return(GM_OK);
     }
 
     /* debug-result */
     else if ( !strcmp( key, "debug-result" ) ) {
         opt->debug_result = parse_yes_or_no(value, GM_ENABLED);
+        return(GM_OK);
     }
 
     /* encryption */
     else if ( !strcmp( key, "encryption" ) ) {
         opt->encryption = parse_yes_or_no(value, GM_ENABLED);
+        return(GM_OK);
     }
 
     /* fork_on_exec */
     else if ( !strcmp( key, "fork_on_exec" ) ) {
         opt->fork_on_exec = parse_yes_or_no(value, GM_ENABLED);
+        return(GM_OK);
     }
 
     /* active */
     else if (   !strcmp( key, "active" ) ) {
         opt->active = parse_yes_or_no(value, GM_ENABLED);
+        return(GM_OK);
+    }
+    else if ( value == NULL || !strcmp(value, "" ) ) {
+        gm_log( GM_LOG_ERROR, "unknown switch '%s'\n", key );
+        return(GM_OK);
     }
 
     if ( value == NULL )
@@ -569,6 +582,9 @@ int parse_args_line(mod_gm_opt_t *opt, char * arg, int recursion_level) {
             }
         }
     }
+    else {
+        gm_log( GM_LOG_ERROR, "unknown option '%s'\n", key );
+    }
     return(GM_OK);
 }
 

-- 
Debian packaging for mod gearman.



More information about the Pkg-nagios-changes mailing list