mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-06-08 16:26:23 -04:00
fix the obvious...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1972 f882894a-f735-0410-b71e-b25c423dba1c
This commit is contained in:
parent
d001e08133
commit
63897a4179
1 changed files with 3 additions and 3 deletions
|
|
@ -99,19 +99,19 @@ np_arg_list* np_get_defaults(const char *locator, const char *default_section){
|
|||
/* if a file was specified or if we're using the default file */
|
||||
if(i.file != NULL && strlen(i.file) > 0){
|
||||
if(strcmp(i.file, "-")==0){
|
||||
inifile=stdout; /* FIXME: Shouldn't it be 'stdin' ??? */
|
||||
inifile=stdin;
|
||||
} else {
|
||||
inifile=fopen(i.file, "r");
|
||||
}
|
||||
if(inifile==NULL) die(STATE_UNKNOWN, _("Can't read config file"));
|
||||
if(read_defaults(inifile, i.stanza, &defaults)==FALSE && strcmp(i.stanza, default_section) && inifile!=stdout) { /* FIXME: Shouldn't it be 'stdin' ??? */
|
||||
if(read_defaults(inifile, i.stanza, &defaults)==FALSE && strcmp(i.stanza, default_section) && inifile!=stdin) {
|
||||
/* We got nothing, try the default section */
|
||||
rewind(inifile);
|
||||
read_defaults(inifile, default_section, &defaults);
|
||||
}
|
||||
|
||||
free(i.file);
|
||||
if(inifile!=stdout) fclose(inifile); /* FIXME: Shouldn't it be 'stdin' ??? */
|
||||
if(inifile!=stdin) fclose(inifile);
|
||||
}
|
||||
free(i.stanza);
|
||||
return defaults;
|
||||
|
|
|
|||
Loading…
Reference in a new issue