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
+1 -1
View File
@@ -143,7 +143,7 @@ int get_state_one_unit(sd_bus *bus, const char *unit, UnitActiveState *ret_activ
state = unit_active_state_from_string(buf);
if (state < 0)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Invalid unit state '%s' for: %s", buf, unit);
return log_error_errno(state, "Invalid unit state '%s' for: %s", buf, unit);
*ret_active_state = state;
return 0;