(void) slice_make_perpetual(m, SPECIAL_SYSTEM_SLICE, NULL);
}
-static bool slice_can_freeze(Unit *s) {
- Unit *member;
-
- assert(s);
+static bool slice_can_freeze(const Unit *u) {
+ assert(u);
- UNIT_FOREACH_DEPENDENCY(member, s, UNIT_ATOM_SLICE_OF)
+ Unit *member;
+ UNIT_FOREACH_DEPENDENCY(member, u, UNIT_ATOM_SLICE_OF)
if (!unit_can_freeze(member))
return false;
+
return true;
}
*ret_target = tgt;
}
-bool unit_can_freeze(Unit *u) {
+bool unit_can_freeze(const Unit *u) {
assert(u);
if (unit_has_name(u, SPECIAL_ROOT_SLICE) || unit_has_name(u, SPECIAL_INIT_SCOPE))
/* Freeze or thaw the unit. Returns > 0 to indicate that the request will be handled asynchronously; unit_frozen
* or unit_thawed should be called once the operation is done. Returns 0 if done successfully, or < 0 on error. */
int (*freezer_action)(Unit *u, FreezerAction a);
- bool (*can_freeze)(Unit *u);
+ bool (*can_freeze)(const Unit *u);
/* Return which kind of data can be cleaned */
int (*can_clean)(Unit *u, ExecCleanMask *ret);
bool unit_can_stop_refuse_manual(Unit *u);
bool unit_can_isolate_refuse_manual(Unit *u);
-bool unit_can_freeze(Unit *u);
+bool unit_can_freeze(const Unit *u);
int unit_freezer_action(Unit *u, FreezerAction action);
void unit_next_freezer_state(Unit *u, FreezerAction a, FreezerState *ret, FreezerState *ret_tgt);
void unit_frozen(Unit *u);