fix dbus disconnection on error
authorJosé Bollo <jose.bollo@iot.bzh>
Wed, 11 May 2016 09:56:42 +0000 (11:56 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Wed, 11 May 2016 09:58:06 +0000 (11:58 +0200)
Change-Id: Ifddabb8c76094fca088ad5250b8dde30a48946c7
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
plugins/afm-main-plugin/utils-jbus.c

index ec2ee01..c4146a4 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <json-c/json.h>
 #include <systemd/sd-bus.h>
+#include <systemd/sd-bus-protocol.h>
 
 #include "utils-jbus.h"
 
@@ -518,7 +519,7 @@ void jbus_unref(struct jbus *jbus)
  */
 int jbus_reply_error_s(struct sd_bus_message *smsg, const char *error)
 {
-       return mkerrno(sd_bus_reply_method_errorf(smsg, "error", "%s", error));
+       return mkerrno(sd_bus_reply_method_errorf(smsg, SD_BUS_ERROR_FAILED, "%s", error));
 }
 
 /*