core: unit_watch_pidref() gracefully handles EEXIST

No need to check that at callsite.
This commit is contained in:
Mike Yuan
2025-04-11 23:43:25 +02:00
parent 55e4df21ef
commit 66f83537f9
3 changed files with 4 additions and 4 deletions

View 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;
}

View 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;
}

View 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;
}
}