core: introduce unit_unwatch_pidref_done() helper function

No functional change, just refactoring.
This commit is contained in:
Yu Watanabe
2024-01-26 00:31:02 +09:00
parent ec5e2a1393
commit ea1e0bf10b
6 changed files with 16 additions and 30 deletions
+10
View File
@@ -2934,6 +2934,16 @@ void unit_unwatch_all_pids(Unit *u) {
u->pids = set_free(u->pids);
}
void unit_unwatch_pidref_done(Unit *u, PidRef *pidref) {
assert(u);
if (!pidref_is_set(pidref))
return;
unit_unwatch_pidref(u, pidref);
pidref_done(pidref);
}
static void unit_tidy_watch_pids(Unit *u) {
PidRef *except1, *except2, *e;