summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <withnall@endlessm.com>2019-06-12 08:44:21 +0100
committerPhilip Withnall <withnall@endlessm.com>2019-07-29 12:13:51 +0100
commitef71cc77873c9697e8fb91ee1ca25c40d138c224 (patch)
tree806c1f25fce524951a3c831275405401bc3d32ea
parent88bc86fcf895da0d51ddaf93d17b4280f4e60d74 (diff)
downloadsystemd-ef71cc77873c9697e8fb91ee1ca25c40d138c224.tar.gz
dbus-scope: Factor out common UNIT(s) cast
This introduces no functional changes. Signed-off-by: Philip Withnall <withnall@endlessm.com>
-rw-r--r--src/core/dbus-scope.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/dbus-scope.c b/src/core/dbus-scope.c
index 8eb915e508..9b8fed69cb 100644
--- a/src/core/dbus-scope.c
+++ b/src/core/dbus-scope.c
@@ -59,6 +59,7 @@ static int bus_scope_set_transient_property(
UnitWriteFlags flags,
sd_bus_error *error) {
+ Unit *u = UNIT(s);
int r;
assert(s);
@@ -68,7 +69,7 @@ static int bus_scope_set_transient_property(
flags |= UNIT_PRIVATE;
if (streq(name, "TimeoutStopUSec"))
- return bus_set_transient_usec(UNIT(s), name, &s->timeout_stop_usec, message, flags, error);
+ return bus_set_transient_usec(u, name, &s->timeout_stop_usec, message, flags, error);
if (streq(name, "PIDs")) {
_cleanup_(sd_bus_creds_unrefp) sd_bus_creds *creds = NULL;
@@ -101,12 +102,12 @@ static int bus_scope_set_transient_property(
} else
pid = (uid_t) upid;
- r = unit_pid_attachable(UNIT(s), pid, error);
+ r = unit_pid_attachable(u, pid, error);
if (r < 0)
return r;
if (!UNIT_WRITE_FLAGS_NOOP(flags)) {
- r = unit_watch_pid(UNIT(s), pid, false);
+ r = unit_watch_pid(u, pid, false);
if (r < 0 && r != -EEXIST)
return r;
}
@@ -128,7 +129,7 @@ static int bus_scope_set_transient_property(
/* We can't support direct connections with this, as direct connections know no service or unique name
* concept, but the Controller field stores exactly that. */
- if (sd_bus_message_get_bus(message) != UNIT(s)->manager->api_bus)
+ if (sd_bus_message_get_bus(message) != u->manager->api_bus)
return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED, "Sorry, Controller= logic only supported via the bus.");
r = sd_bus_message_read(message, "s", &controller);