]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/dbus: make two functions return void
authorMike Yuan <me@yhndnzj.com>
Wed, 17 Jul 2024 15:52:00 +0000 (17:52 +0200)
committerMike Yuan <me@yhndnzj.com>
Sun, 21 Jul 2024 20:48:52 +0000 (22:48 +0200)
src/core/dbus.c
src/core/dbus.h

index 1c6f6fc8b3838151e2da5ae92be4d8d15aa973d2..39cce302db89af929b51de70c42a8e661e436781 100644 (file)
 
 static void destroy_bus(Manager *m, sd_bus **bus);
 
-int bus_send_pending_reload_message(Manager *m) {
+void bus_send_pending_reload_message(Manager *m) {
         int r;
 
         assert(m);
 
         if (!m->pending_reload_message)
-                return 0;
+                return;
 
         /* If we cannot get rid of this message we won't dispatch any D-Bus messages, so that we won't end up wanting
          * to queue another message. */
 
         r = sd_bus_send(NULL, m->pending_reload_message, NULL);
         if (r < 0)
-                log_warning_errno(r, "Failed to send queued message, ignoring: %m");
+                log_warning_errno(r, "Failed to send queued reload message, ignoring: %m");
 
         m->pending_reload_message = sd_bus_message_unref(m->pending_reload_message);
 
-        return 0;
+        return;
 }
 
 int bus_forward_agent_released(Manager *m, const char *path) {
@@ -857,7 +857,7 @@ int bus_init_api(Manager *m) {
         return 0;
 }
 
-static int bus_setup_system(Manager *m, sd_bus *bus) {
+static void bus_setup_system(Manager *m, sd_bus *bus) {
         int r;
 
         assert(m);
@@ -878,7 +878,7 @@ static int bus_setup_system(Manager *m, sd_bus *bus) {
         }
 
         log_debug("Successfully connected to system bus.");
-        return 0;
+        return;
 }
 
 int bus_init_system(Manager *m) {
@@ -905,9 +905,7 @@ int bus_init_system(Manager *m) {
                         return r;
         }
 
-        r = bus_setup_system(m, bus);
-        if (r < 0)
-                return log_error_errno(r, "Failed to set up system bus: %m");
+        bus_setup_system(m, bus);
 
         m->system_bus = TAKE_PTR(bus);
 
index 50e7bb400e92bb7b599f360e1267b335fd60eab6..ae754040761e11a0d01bd769d38e13875047923d 100644 (file)
@@ -5,7 +5,7 @@
 
 #include "manager.h"
 
-int bus_send_pending_reload_message(Manager *m);
+void bus_send_pending_reload_message(Manager *m);
 
 int bus_init_private(Manager *m);
 int bus_init_api(Manager *m);