summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2016-11-15 10:09:11 +0100
committerPeter Rajnoha <prajnoha@redhat.com>2016-11-15 10:09:11 +0100
commitcd0736a94554750e0077f390770212c68da8fa4e (patch)
treeb0e1d3bbf253876fd02a688aff7777fc0548fe52
parent68d6d342f83f00784b53dda254d66875e134808d (diff)
downloadlvm2-cd0736a94554750e0077f390770212c68da8fa4e.tar.gz
dbus: also recognize error state for missing service that comes from original D-Bus
-rw-r--r--lib/notify/lvmnotify.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/notify/lvmnotify.c b/lib/notify/lvmnotify.c
index ac0ca73c6..1daee1e4a 100644
--- a/lib/notify/lvmnotify.c
+++ b/lib/notify/lvmnotify.c
@@ -15,7 +15,8 @@
#define LVM_DBUS_DESTINATION "com.redhat.lvmdbus1"
#define LVM_DBUS_PATH "/com/redhat/lvmdbus1/Manager"
#define LVM_DBUS_INTERFACE "com.redhat.lvmdbus1.Manager"
-#define SD_BUS_NO_SUCH_UNIT_ERROR "org.freedesktop.systemd1.NoSuchUnit"
+#define SD_BUS_SYSTEMD_NO_SUCH_UNIT_ERROR "org.freedesktop.systemd1.NoSuchUnit"
+#define SD_BUS_DBUS_SERVICE_UNKNOWN_ERROR "org.freedesktop.DBus.Error.ServiceUnknown"
#ifdef NOTIFYDBUS_SUPPORT
#include <systemd/sd-bus.h>
@@ -63,7 +64,8 @@ void lvmnotify_send(struct cmd_context *cmd)
cmd_name);
if (ret < 0) {
- if (sd_bus_error_has_name(&error, SD_BUS_NO_SUCH_UNIT_ERROR))
+ if (sd_bus_error_has_name(&error, SD_BUS_SYSTEMD_NO_SUCH_UNIT_ERROR) ||
+ sd_bus_error_has_name(&error, SD_BUS_DBUS_SERVICE_UNKNOWN_ERROR))
log_debug_dbus("%s: %s", _dbus_notification_failed_msg, error.message);
else
log_warn("WARNING: %s: %s", _dbus_notification_failed_msg, error.message);