]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/core/swap.c
core: port unit_fork_helper_process() and unit_fork_and_watch_rm_rf() to PidRef
[thirdparty/systemd.git] / src / core / swap.c
index e06de629da32f759530117115a6d573396af4b11..aa04b99462275948feaaf4b22cdf4a8f569d9da3 100644 (file)
@@ -1519,7 +1519,6 @@ static PidRef* swap_control_pid(Unit *u) {
 static int swap_clean(Unit *u, ExecCleanMask mask) {
         _cleanup_strv_free_ char **l = NULL;
         Swap *s = SWAP(u);
-        pid_t pid;
         int r;
 
         assert(s);
@@ -1544,11 +1543,7 @@ static int swap_clean(Unit *u, ExecCleanMask mask) {
         if (r < 0)
                 goto fail;
 
-        r = unit_fork_and_watch_rm_rf(u, l, &pid);
-        if (r < 0)
-                goto fail;
-
-        r = pidref_set_pid(&s->control_pid, pid);
+        r = unit_fork_and_watch_rm_rf(u, l, &s->control_pid);
         if (r < 0)
                 goto fail;