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 commitf96742e512) (cherry picked from commit9dbbb8ad2b)
This commit is contained in:
1 parent
6a309ddc4e
commit
7dad4ead9b
1 file changed
+8
@@ -829,6 +829,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