From: Philip Withnall Date: Wed, 12 Jun 2019 07:44:21 +0000 (+0100) Subject: dbus-scope: Factor out common UNIT(s) cast X-Git-Tag: v244~176^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ef71cc77873c9697e8fb91ee1ca25c40d138c224;p=platform%2Fupstream%2Fsystemd.git dbus-scope: Factor out common UNIT(s) cast This introduces no functional changes. Signed-off-by: Philip Withnall --- diff --git a/src/core/dbus-scope.c b/src/core/dbus-scope.c index 8eb915e..9b8fed6 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);