]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/scope: drop effectively unused unit_watch_pidref() calls
authorMike Yuan <me@yhndnzj.com>
Fri, 11 Jul 2025 19:58:51 +0000 (21:58 +0200)
committerMike Yuan <me@yhndnzj.com>
Fri, 11 Jul 2025 19:58:51 +0000 (21:58 +0200)
Follow-up for 495e75ed5c8cce933947dae10a4a1b5f8067e432

The mentioned commit switched scope unit's "pids" deserialization
to call unit_watch_pid() already, meaning all later invocations
in scope_coldplug() are no-op. Remove the cruft altogether.

src/core/scope.c

index def2039e1a7cf8f6557e9eb361a476881ee254c8..83b7d2d46fd533300e8a31527a7b66a2f64f8859 100644 (file)
@@ -236,15 +236,6 @@ static int scope_coldplug(Unit *u) {
         if (r < 0)
                 return r;
 
-        if (!IN_SET(s->deserialized_state, SCOPE_DEAD, SCOPE_FAILED) && u->pids) {
-                PidRef *pid;
-                SET_FOREACH(pid, u->pids) {
-                        r = unit_watch_pidref(u, pid, /* exclusive= */ false);
-                        if (r < 0)
-                                return r;
-                }
-        }
-
         bus_scope_track_controller(s);
 
         scope_set_state(s, s->deserialized_state);