chiark / gitweb /
bus: parse uid/gid/pid/tid meta data from kdbus messages
[elogind.git] / src / libsystemd-bus / test-bus-server.c
index a594ce3157f529e9690a1a7f1fe7dc4fc0238fce..a9772624f22ee11cb697b5f51775f7a158a5cef2 100644 (file)
@@ -96,9 +96,10 @@ static void *server(void *p) {
                         quit = true;
 
                 } else if (sd_bus_message_is_method_call(m, NULL, NULL)) {
                         quit = true;
 
                 } else if (sd_bus_message_is_method_call(m, NULL, NULL)) {
-                        const sd_bus_error e = SD_BUS_ERROR_INIT_CONST("org.freedesktop.DBus.Error.UnknownMethod", "Unknown method.");
-
-                        r = sd_bus_message_new_method_error(bus, m, &e, &reply);
+                        r = sd_bus_message_new_method_error(
+                                        bus, m,
+                                        &SD_BUS_ERROR_MAKE("org.freedesktop.DBus.Error.UnknownMethod", "Unknown method."),
+                                        &reply);
                         if (r < 0) {
                                 log_error("Failed to allocate return: %s", strerror(-r));
                                 goto fail;
                         if (r < 0) {
                                 log_error("Failed to allocate return: %s", strerror(-r));
                                 goto fail;
@@ -128,7 +129,7 @@ fail:
 static int client(struct context *c) {
         _cleanup_bus_message_unref_ sd_bus_message *m = NULL, *reply = NULL;
         _cleanup_bus_unref_ sd_bus *bus = NULL;
 static int client(struct context *c) {
         _cleanup_bus_message_unref_ sd_bus_message *m = NULL, *reply = NULL;
         _cleanup_bus_unref_ sd_bus *bus = NULL;
-        sd_bus_error error = SD_BUS_ERROR_INIT;
+        sd_bus_error error = SD_BUS_ERROR_NULL;
         int r;
 
         assert_se(sd_bus_new(&bus) >= 0);
         int r;
 
         assert_se(sd_bus_new(&bus) >= 0);