summaryrefslogtreecommitdiffstats
path: root/lib/parse_ini.c
diff options
context:
space:
mode:
authorThomas Guyot-Sionnest <dermoth@aei.ca>2009-01-22 07:24:39 (GMT)
committerThomas Guyot-Sionnest <dermoth@aei.ca>2009-01-22 07:24:39 (GMT)
commit485f306868fa9c89b4f09e3b2b813d93ec64f0b4 (patch)
tree0431458903d177fee9633fdd23d7f1594c8bf70d /lib/parse_ini.c
parentbf4abd539507e1194d836e6e818bda4807f497bf (diff)
downloadmonitoring-plugins-485f306868fa9c89b4f09e3b2b813d93ec64f0b4.tar.gz
Return UNKNOWN if none of the default files can be found.
It makes no sense to return unknown if an implicit section is not found, but go on if the file is missing
Diffstat (limited to 'lib/parse_ini.c')
-rw-r--r--lib/parse_ini.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/parse_ini.c b/lib/parse_ini.c
index 1d64a50..004396f 100644
--- a/lib/parse_ini.c
+++ b/lib/parse_ini.c
@@ -75,6 +75,9 @@ static void parse_locator(const char *locator, const char *def_stanza, np_ini_in
75 /* if there is no @file part */ 75 /* if there is no @file part */
76 if(stanza_len==locator_len){ 76 if(stanza_len==locator_len){
77 i->file=default_file(); 77 i->file=default_file();
78 if(strcmp(i->file, "") == 0){
79 die(STATE_UNKNOWN, _("Cannot find '%s' or '%s' in any standard location.\n"), NP_DEFAULT_INI_FILENAME1, NP_DEFAULT_INI_FILENAME2);
80 }
78 } else { 81 } else {
79 i->file=strdup(&(locator[stanza_len+1])); 82 i->file=strdup(&(locator[stanza_len+1]));
80 } 83 }