core: introduce unit_destroy_runtime_directory()
Currently `unit_will_restart()` can return true only when the unit is service. Hence, should not change anything.
This commit is contained in:
@@ -5880,6 +5880,12 @@ int unit_test_trigger_loaded(Unit *u) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void unit_destroy_runtime_directory(Unit *u, const ExecContext *context) {
|
||||
if (context->runtime_directory_preserve_mode == EXEC_PRESERVE_NO ||
|
||||
(context->runtime_directory_preserve_mode == EXEC_PRESERVE_RESTART && !unit_will_restart(u)))
|
||||
exec_context_destroy_runtime_directory(context, u->manager->prefix[EXEC_DIRECTORY_RUNTIME]);
|
||||
}
|
||||
|
||||
int unit_clean(Unit *u, ExecCleanMask mask) {
|
||||
UnitActiveState state;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user