mirror of
https://github.com/systemd/systemd.git
synced 2026-08-03 22:50:29 +00:00
core: unit_watch_pidref() gracefully handles EEXIST
No need to check that at callsite.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user