mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-04-22 22:56:58 -04:00
lib/parse_ini.c: Print proper read error message
Print a useful error message if opening the configuration file fails.
This commit is contained in:
parent
48025ff39c
commit
dc0f25cf76
1 changed files with 2 additions and 1 deletions
|
|
@ -129,7 +129,8 @@ np_get_defaults(const char *locator, const char *default_section)
|
|||
inifile = strcmp(i.file, "-") == 0 ? stdin : fopen(i.file, "r");
|
||||
|
||||
if (inifile == NULL)
|
||||
die(STATE_UNKNOWN, "%s\n", _("Can't read config file"));
|
||||
die(STATE_UNKNOWN, _("Can't read config file: %s\n"),
|
||||
strerror(errno));
|
||||
if (read_defaults(inifile, i.stanza, &defaults) == FALSE)
|
||||
die(STATE_UNKNOWN,
|
||||
_("Invalid section '%s' in config file '%s'\n"), i.stanza,
|
||||
|
|
|
|||
Loading…
Reference in a new issue