From 4852e15970ec652b823bf568b398f730be1fe1a5 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Thu, 5 Feb 2015 17:59:40 +0100 Subject: [PATCH] networkd: gracefully handle failure to emit signals when dbus is not connected When we get kdbus we don't need these hackse. --- src/network/networkd-link-bus.c | 3 +++ src/network/networkd-manager-bus.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/network/networkd-link-bus.c b/src/network/networkd-link-bus.c index 645c47ae8c0..f7eae87edd1 100644 --- a/src/network/networkd-link-bus.c +++ b/src/network/networkd-link-bus.c @@ -108,6 +108,9 @@ int link_send_changed(Link *link, const char *property, ...) { assert(link); assert(link->manager); + if (!link->manager->bus) + return 0; /* replace with assert when we have kdbus */ + l = strv_from_stdarg_alloca(property); p = link_bus_path(link); diff --git a/src/network/networkd-manager-bus.c b/src/network/networkd-manager-bus.c index 7753c5dbc9a..b281f4fdb6c 100644 --- a/src/network/networkd-manager-bus.c +++ b/src/network/networkd-manager-bus.c @@ -38,6 +38,9 @@ int manager_send_changed(Manager *manager, const char *property, ...) { assert(manager); + if (!manager->bus) + return 0; /* replace by assert when we have kdbus */ + l = strv_from_stdarg_alloca(property); return sd_bus_emit_properties_changed_strv(