assert(o);
assert(o->type == OPERATION_ACQUIRE);
+ assert(!h->current_operation);
+
switch (home_get_state(h)) {
case HOME_UNFIXATED:
break;
case HOME_ABSENT:
- r = sd_bus_error_setf(&error, BUS_ERROR_HOME_ABSENT, "Home %s is currently missing or not plugged in.", h->user_name);
- break;
+ r = sd_bus_error_setf(&error, BUS_ERROR_HOME_ABSENT,
+ "Home %s is currently missing or not plugged in.", h->user_name);
+ goto check;
case HOME_INACTIVE:
case HOME_DIRTY:
return 0;
}
- assert(!h->current_operation);
-
- if (call) {
- r = home_ratelimit(h, &error);
- if (r >= 0)
- r = call(h, o->secret, for_state, &error);
- }
+ r = home_ratelimit(h, &error);
+ if (r >= 0)
+ r = call(h, o->secret, for_state, &error);
+ check:
if (r != 0) /* failure or completed */
operation_result(o, r, &error);
else /* ongoing */