fundamental: rework IN_SET() to require at least three arguments

If less than three parameters are passed a simple comparison is the
better choice.

Lo and behold this found two pretty bad typos.
This commit is contained in:
Lennart Poettering
2023-01-02 17:16:50 +01:00
parent efa75d7022
commit 4f06325ce9
9 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -864,7 +864,7 @@ static int timer_clean(Unit *u, ExecCleanMask mask) {
if (t->state != TIMER_DEAD)
return -EBUSY;
if (!IN_SET(mask, EXEC_CLEAN_STATE))
if (mask != EXEC_CLEAN_STATE)
return -EUNATCH;
r = timer_setup_persistent(t);
+1 -1
View File
@@ -5793,7 +5793,7 @@ int unit_clean(Unit *u, ExecCleanMask mask) {
return -EBUSY;
state = unit_active_state(u);
if (!IN_SET(state, UNIT_INACTIVE))
if (state != UNIT_INACTIVE)
return -EBUSY;
return UNIT_VTABLE(u)->clean(u, mask);