diff options
author | Martin Schwenke <martin@meltin.net> | 2018-08-31 08:42:04 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2018-09-03 10:52:11 +0200 |
commit | 920ed66ba7e874ca23d72fff9342fbd64a1e329f (patch) | |
tree | defe8941b96fad94b1109e6228b817d2a530b31e /ctdb/common | |
parent | f1084400387c0b1257b6d92ee6e8a89504d788fc (diff) | |
download | samba-920ed66ba7e874ca23d72fff9342fbd64a1e329f.tar.gz |
ctdb-common: Avoid ENOENT for unknown conf options
Only use ENOENT for missing configuration file.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/common')
-rw-r--r-- | ctdb/common/conf.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ctdb/common/conf.c b/ctdb/common/conf.c index 2758d2628f2..8bc375b166d 100644 --- a/ctdb/common/conf.c +++ b/ctdb/common/conf.c @@ -1121,7 +1121,7 @@ static bool conf_load_option(const char *name, D_ERR("conf: unknown option [%s] -> \"%s\"\n", state->s->name, name); - state->err = ENOENT; + state->err = EINVAL; return false; } } @@ -1207,16 +1207,16 @@ static int conf_set(struct conf_context *conf, s = conf_section_find(conf, section); if (s == NULL) { - return ENOENT; + return EINVAL; } opt = conf_option_find(s, key); if (opt == NULL) { - return ENOENT; + return EINVAL; } if (opt->type != value->type) { - return ENOENT; + return EINVAL; } ok = conf_option_same_value(opt, value); @@ -1291,12 +1291,12 @@ static int conf_get(struct conf_context *conf, s = conf_section_find(conf, section); if (s == NULL) { - return ENOENT; + return EINVAL; } opt = conf_option_find(s, key); if (opt == NULL) { - return ENOENT; + return EINVAL; } if (opt->type != type) { |