tree-wide: propagate error code from _from_string() functions

Now that we know we have something useful, no need to make an answer up.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2021-02-10 14:46:59 +01:00
parent 751db3b4cd
commit 7211c853c2
27 changed files with 62 additions and 81 deletions
+2 -2
View File
@@ -1085,7 +1085,7 @@ int log_set_target_from_string(const char *e) {
t = log_target_from_string(e);
if (t < 0)
return -EINVAL;
return t;
log_set_target(t);
return 0;
@@ -1096,7 +1096,7 @@ int log_set_max_level_from_string(const char *e) {
t = log_level_from_string(e);
if (t < 0)
return -EINVAL;
return t;
log_set_max_level(t);
return 0;
+1 -1
View File
@@ -252,7 +252,7 @@ int unit_name_build(const char *prefix, const char *instance, const char *suffix
type = unit_type_from_string(suffix + 1);
if (type < 0)
return -EINVAL;
return type;
return unit_name_build_from_type(prefix, instance, type, ret);
}