]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: unit_watch_pidref() gracefully handles EEXIST 37099/head
authorMike Yuan <me@yhndnzj.com>
Fri, 11 Apr 2025 21:43:25 +0000 (23:43 +0200)
committerMike Yuan <me@yhndnzj.com>
Fri, 11 Apr 2025 21:50:50 +0000 (23:50 +0200)
No need to check that at callsite.

src/core/dbus-manager.c
src/core/dbus-scope.c
src/core/scope.c

index 9e7aba675174a930d65c6c68028242af6895acac..8addce3d102d88697c16a10eadf54b2331177453 100644 (file)
@@ -2947,7 +2947,7 @@ static int aux_scope_from_message(Manager *m, sd_bus_message *message, Unit **re
                         return r;
 
                 r = unit_watch_pidref(scope, p, /* exclusive= */ false);
-                if (r < 0 && r != -EEXIST)
+                if (r < 0)
                         return r;
         }
 
index 15c3595a42bddd723d415ff6b1db0b50d20c730c..f3beee92e705245b0725046fb4bf907541ee5a48 100644 (file)
@@ -125,7 +125,7 @@ static int bus_scope_set_transient_property(
 
                         if (!UNIT_WRITE_FLAGS_NOOP(flags)) {
                                 r = unit_watch_pidref(u, p, /* exclusive= */ false);
-                                if (r < 0 && r != -EEXIST)
+                                if (r < 0)
                                         return r;
                         }
 
@@ -166,7 +166,7 @@ static int bus_scope_set_transient_property(
 
                         if (!UNIT_WRITE_FLAGS_NOOP(flags)) {
                                 r = unit_watch_pidref(u, &pidref, /* exclusive= */ false);
-                                if (r < 0 && r != -EEXIST)
+                                if (r < 0)
                                         return r;
                         }
 
index 9e14b78da2772e898674405c7de12d5c7f523985..40fb41e541a87287fe41e218c1886b4b21382ad7 100644 (file)
@@ -239,7 +239,7 @@ static int scope_coldplug(Unit *u) {
                 PidRef *pid;
                 SET_FOREACH(pid, u->pids) {
                         r = unit_watch_pidref(u, pid, /* exclusive= */ false);
-                        if (r < 0 && r != -EEXIST)
+                        if (r < 0)
                                 return r;
                 }
         }