summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/common/conf.c12
-rwxr-xr-xctdb/tests/cunit/conf_test_001.sh2
-rwxr-xr-xctdb/tests/cunit/config_test_001.sh2
3 files changed, 8 insertions, 8 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) {
diff --git a/ctdb/tests/cunit/conf_test_001.sh b/ctdb/tests/cunit/conf_test_001.sh
index a1a84585b1e..caca9314953 100755
--- a/ctdb/tests/cunit/conf_test_001.sh
+++ b/ctdb/tests/cunit/conf_test_001.sh
@@ -120,7 +120,7 @@ cat > "$conffile" <<EOF
key2 = 20
EOF
-required_result 2 <<EOF
+required_error EINVAL <<EOF
conf: unknown option [section1] -> "foo"
[section1]
# key1 = value1
diff --git a/ctdb/tests/cunit/config_test_001.sh b/ctdb/tests/cunit/config_test_001.sh
index e58f710ac4d..d213aa88bfd 100755
--- a/ctdb/tests/cunit/config_test_001.sh
+++ b/ctdb/tests/cunit/config_test_001.sh
@@ -101,7 +101,7 @@ cat > "$conffile" <<EOF
log level = debug
EOF
-required_result 2 <<EOF
+required_error EINVAL <<EOF
conf: unknown option [database] -> "unknown key"
Failed to load config file $conffile
EOF