summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2014-06-18 21:42:57 (GMT)
committerHolger Weiss <holger@zedat.fu-berlin.de>2014-06-18 21:42:57 (GMT)
commitdc0f25cf76397b13f39a1d0fc50e9174114478ca (patch)
treee55910306c135edc1f374909bd1a10eeee9ff67b /lib
parent48025ff39c3a78b7805bf803ac96730cef53e15c (diff)
downloadmonitoring-plugins-dc0f25cf76397b13f39a1d0fc50e9174114478ca.tar.gz
lib/parse_ini.c: Print proper read error message
Print a useful error message if opening the configuration file fails.
Diffstat (limited to 'lib')
-rw-r--r--lib/parse_ini.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/parse_ini.c b/lib/parse_ini.c
index 86b94e7..25abc89 100644
--- a/lib/parse_ini.c
+++ b/lib/parse_ini.c
@@ -129,7 +129,8 @@ np_get_defaults(const char *locator, const char *default_section)
129 inifile = strcmp(i.file, "-") == 0 ? stdin : fopen(i.file, "r"); 129 inifile = strcmp(i.file, "-") == 0 ? stdin : fopen(i.file, "r");
130 130
131 if (inifile == NULL) 131 if (inifile == NULL)
132 die(STATE_UNKNOWN, "%s\n", _("Can't read config file")); 132 die(STATE_UNKNOWN, _("Can't read config file: %s\n"),
133 strerror(errno));
133 if (read_defaults(inifile, i.stanza, &defaults) == FALSE) 134 if (read_defaults(inifile, i.stanza, &defaults) == FALSE)
134 die(STATE_UNKNOWN, 135 die(STATE_UNKNOWN,
135 _("Invalid section '%s' in config file '%s'\n"), i.stanza, 136 _("Invalid section '%s' in config file '%s'\n"), i.stanza,