From: Mike Yuan Date: Fri, 11 Apr 2025 21:43:25 +0000 (+0200) Subject: core: unit_watch_pidref() gracefully handles EEXIST X-Git-Tag: v258-rc1~839^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F37099%2Fhead;p=thirdparty%2Fsystemd.git core: unit_watch_pidref() gracefully handles EEXIST No need to check that at callsite. --- diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c index 9e7aba67517..8addce3d102 100644 --- a/src/core/dbus-manager.c +++ b/src/core/dbus-manager.c @@ -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; } diff --git a/src/core/dbus-scope.c b/src/core/dbus-scope.c index 15c3595a42b..f3beee92e70 100644 --- a/src/core/dbus-scope.c +++ b/src/core/dbus-scope.c @@ -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; } diff --git a/src/core/scope.c b/src/core/scope.c index 9e14b78da27..40fb41e541a 100644 --- a/src/core/scope.c +++ b/src/core/scope.c @@ -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; } }