chiark / gitweb /
busctl: use canned error message on parse failure
authorLennart Poettering <lennart@poettering.net>
Thu, 20 Nov 2014 19:59:57 +0000 (20:59 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 20 Nov 2014 23:32:02 +0000 (00:32 +0100)
src/libsystemd/sd-bus/busctl.c

index 33be4e8..4da8074 100644 (file)
@@ -35,6 +35,7 @@
 #include "bus-util.h"
 #include "bus-dump.h"
 #include "bus-signature.h"
+#include "bus-type.h"
 #include "busctl-introspect.h"
 
 static bool arg_no_pager = false;
@@ -1213,10 +1214,8 @@ static int call(sd_bus *bus, char *argv[]) {
         }
 
         r = sd_bus_message_new_method_call(bus, &m, argv[1], argv[2], argv[3], argv[4]);
-        if (r < 0) {
-                log_error("Failed to prepare bus message: %s", strerror(-r));
-                return r;
-        }
+        if (r < 0)
+                return bus_log_create_error(r);
 
         if (!isempty(argv[5])) {
                 char **p;