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