mirror of
https://github.com/systemd/systemd.git
synced 2024-12-25 01:34:28 +03:00
core: Unit's condition_result field is a boolean
Let's only assign boolean values to a boolean variable. Unit's condition_result is not of type ConditionResult, slightly confusingly. Let's hence not assign one of ConditionResult's values to it, but simple booleans. This effectively doesn't make a difference, since CONDITION_ERROR is true when cast to bool. But it's still ugly to rely on that. And confusing.
This commit is contained in:
parent
a3a5446b76
commit
d52cc0a531
@ -1727,7 +1727,7 @@ static bool unit_test_condition(Unit *u) {
|
||||
r = manager_get_effective_environment(u->manager, &env);
|
||||
if (r < 0) {
|
||||
log_unit_error_errno(u, r, "Failed to determine effective environment: %m");
|
||||
u->condition_result = CONDITION_ERROR;
|
||||
u->condition_result = true;
|
||||
} else
|
||||
u->condition_result = condition_test_list(
|
||||
u->conditions,
|
||||
|
Loading…
Reference in New Issue
Block a user