mirror of
https://github.com/systemd/systemd.git
synced 2026-11-06 05:17:24 +00:00
core/dbus: skip setting up API bus when it is already disconnected.
If it is already disconnected, we cannot setup the API bus anyway,
and shows several spurious errors for e.g. failure in
sd_bus_negotiate_creds().
Co-authored-by: Alvaro Leiva Geisse <aleivag@gmail.com>
(cherry picked from commit f96742e512)
This commit is contained in:
1 parent
dc50905686
commit
9dbbb8ad2b
1 file changed
+8
@@ -831,6 +831,14 @@ static int api_bus_instance_id_reply(sd_bus_message *reply, void *userdata, sd_b
|
||||
assert(reply);
|
||||
assert_se(bus = sd_bus_message_get_bus(reply));
|
||||
|
||||
r = sd_bus_is_open(bus);
|
||||
if (r < 0)
|
||||
log_warning_errno(r, "Failed to check if bus is open, assuming it is, ignoring: %m");
|
||||
else if (r == 0) {
|
||||
log_debug("API bus connection closed before its instance ID was received.");
|
||||
return 0; /* Let's skip the setup and wait for signal_disconnected(). */
|
||||
}
|
||||
|
||||
/* Whatever the outcome, we get only one shot at coldplugging the saved subscription state onto
|
||||
* this connection: consume it. */
|
||||
_cleanup_strv_free_ char **subscribed_as_strv = TAKE_PTR(m->subscribed_as_strv);
|
||||
|
||||
Reference in new issue
Block a user