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:
+2
-2
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user