sd-bus: internalize setting of bus is_system/is_user
Each of bus_set_address_{user,system} had two users, and each of the two users
would set the internal flag manually. We should do that internally in the
functions instead.
While at it, only set the flag when setting the address is actually successful.
This doesn't change anything for current users, but it seems more correct.
This commit is contained in:
+2
-5
@@ -110,13 +110,10 @@ static int acquire_bus(bool set_monitor, sd_bus **ret) {
|
||||
switch (arg_transport) {
|
||||
|
||||
case BUS_TRANSPORT_LOCAL:
|
||||
if (arg_user) {
|
||||
bus->is_user = true;
|
||||
if (arg_user)
|
||||
r = bus_set_address_user(bus);
|
||||
} else {
|
||||
bus->is_system = true;
|
||||
else
|
||||
r = bus_set_address_system(bus);
|
||||
}
|
||||
break;
|
||||
|
||||
case BUS_TRANSPORT_REMOTE:
|
||||
|
||||
Reference in New Issue
Block a user