projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1737d01
)
configfile: Log errors when trying to access unknown global options.
author
Sebastian Harl
<sh@tokkee.org>
Sun, 5 Jun 2016 22:09:58 +0000
(
00:09
+0200)
committer
Sebastian Harl
<sh@tokkee.org>
Sun, 5 Jun 2016 22:09:58 +0000
(
00:09
+0200)
src/daemon/configfile.c
patch
|
blob
|
history
diff --git
a/src/daemon/configfile.c
b/src/daemon/configfile.c
index
93e90e3
..
b9860bd
100644
(file)
--- a/
src/daemon/configfile.c
+++ b/
src/daemon/configfile.c
@@
-939,11
+939,14
@@
int global_option_set (const char *option, const char *value, _Bool from_cli)
break;
if (i >= cf_global_options_num)
break;
if (i >= cf_global_options_num)
+ {
+ ERROR ("configfile: Cannot set unknown global option `%s'.", option);
return (-1);
return (-1);
+ }
if (cf_global_options[i].from_cli && (! from_cli))
{
if (cf_global_options[i].from_cli && (! from_cli))
{
- DEBUG ("
C
onfigfile: Ignoring %s `%s' option because "
+ DEBUG ("
c
onfigfile: Ignoring %s `%s' option because "
"it was overriden by a command-line option.",
option, value);
return (0);
"it was overriden by a command-line option.",
option, value);
return (0);
@@
-970,7
+973,10
@@
const char *global_option_get (const char *option)
break;
if (i >= cf_global_options_num)
break;
if (i >= cf_global_options_num)
+ {
+ ERROR ("configfile: Cannot get unknown global option `%s'.", option);
return (NULL);
return (NULL);
+ }
return ((cf_global_options[i].value != NULL)
? cf_global_options[i].value
return ((cf_global_options[i].value != NULL)
? cf_global_options[i].value