]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
src: changed instances of sd_bus_call_method() to bus_call_method() (#26819)
authorOMOJOLA JOSHUA <109356020+1awesomeJ@users.noreply.github.com>
Wed, 15 Mar 2023 00:12:57 +0000 (01:12 +0100)
committerGitHub <noreply@github.com>
Wed, 15 Mar 2023 00:12:57 +0000 (00:12 +0000)
* src: changed instances of sd_bus_call_method() to bus_call_method()

src/fsck/fsck.c
src/fstab-generator/fstab-generator.c
src/initctl/initctl.c
src/locale/localed.c
src/login/logind-core.c

index e25c5d5efa67b0e29bb862e70780594578f35ba1..cfdc6b24bf908aa8198e7acc06a2499f26a41056 100644 (file)
@@ -17,6 +17,7 @@
 #include "alloc-util.h"
 #include "bus-common-errors.h"
 #include "bus-error.h"
+#include "bus-locator.h"
 #include "bus-util.h"
 #include "device-util.h"
 #include "fd-util.h"
@@ -53,14 +54,7 @@ static void start_target(const char *target, const char *mode) {
         log_info("Requesting %s/start/%s", target, mode);
 
         /* Start this unit only if we can replace basic.target with it */
-        r = sd_bus_call_method(bus,
-                               "org.freedesktop.systemd1",
-                               "/org/freedesktop/systemd1",
-                               "org.freedesktop.systemd1.Manager",
-                               "StartUnitReplace",
-                               &error,
-                               NULL,
-                               "sss", "basic.target", target, mode);
+        r = bus_call_method(bus, bus_systemd_mgr, "StartUnitReplace", &error, NULL, "sss", "basic.target", target, mode);
 
         /* Don't print a warning if we aren't called during startup */
         if (r < 0 && !sd_bus_error_has_name(&error, BUS_ERROR_NO_SUCH_JOB))
index 138321680d7f6a707aca351f37e27a5aeb2ffdb4..28cd5f05f1fc8dfd8615d76cd28dbfca92b7fc1a 100644 (file)
@@ -627,14 +627,7 @@ static int do_daemon_reload(void) {
         FOREACH_STRING(unit, SPECIAL_INITRD_FS_TARGET, SPECIAL_SWAP_TARGET) {
                 log_info("Requesting %s/start/replace...", unit);
 
-                k = sd_bus_call_method(bus,
-                                       "org.freedesktop.systemd1",
-                                       "/org/freedesktop/systemd1",
-                                       "org.freedesktop.systemd1.Manager",
-                                       "StartUnit",
-                                       &error,
-                                       NULL,
-                                       "ss", unit, "replace");
+                k = bus_call_method(bus, bus_systemd_mgr, "StartUnit", &error, NULL, "ss", unit, "replace");
                 if (k < 0) {
                         log_error_errno(k, "Failed to (re)start %s: %s", unit, bus_error_message(&error, r));
                         if (r == 0)
index 0882570a660bfc4656a1394254581330906c5806..99f28721de234d53a3408e52f60c4ebb23d767c6 100644 (file)
@@ -13,6 +13,7 @@
 
 #include "alloc-util.h"
 #include "bus-error.h"
+#include "bus-locator.h"
 #include "bus-util.h"
 #include "constants.h"
 #include "daemon-util.h"
@@ -106,15 +107,7 @@ static int change_runlevel(Server *s, int runlevel) {
 
         log_debug("Requesting %s/start/%s", target, mode);
 
-        r = sd_bus_call_method(
-                        s->bus,
-                        "org.freedesktop.systemd1",
-                        "/org/freedesktop/systemd1",
-                        "org.freedesktop.systemd1.Manager",
-                        "StartUnit",
-                        &error,
-                        NULL,
-                        "ss", target, mode);
+        r = bus_call_method(s->bus, bus_systemd_mgr, "StartUnit", &error, NULL, "ss", target, mode);
         if (r < 0)
                 return log_error_errno(r, "Failed to change runlevel: %s", bus_error_message(&error, r));
 
index 841e5e3e91a56cf6511c5f600cb3fc4f16ef09d9..2f23eab92ba3696dec4c0a7061018f2f3ac5e033 100644 (file)
@@ -14,6 +14,7 @@
 
 #include "alloc-util.h"
 #include "bus-error.h"
+#include "bus-locator.h"
 #include "bus-log-control-api.h"
 #include "bus-message.h"
 #include "bus-polkit.h"
@@ -60,14 +61,7 @@ static int vconsole_reload(sd_bus *bus) {
 
         assert(bus);
 
-        r = sd_bus_call_method(bus,
-                        "org.freedesktop.systemd1",
-                        "/org/freedesktop/systemd1",
-                        "org.freedesktop.systemd1.Manager",
-                        "RestartUnit",
-                        &error,
-                        NULL,
-                        "ss", "systemd-vconsole-setup.service", "replace");
+        r = bus_call_method(bus, bus_systemd_mgr, "RestartUnit", &error, NULL, "ss", "systemd-vconsole-setup.service", "replace");
 
         if (r < 0)
                 return log_error_errno(r, "Failed to issue method call: %s", bus_error_message(&error, r));
index 618850febaf77eeb5c48e73f7f853a85884f9bc0..8e1c54dbe2074d2e08ccbf62624a6fe90bfa4f3b 100644 (file)
@@ -9,6 +9,7 @@
 
 #include "alloc-util.h"
 #include "bus-error.h"
+#include "bus-locator.h"
 #include "bus-util.h"
 #include "cgroup-util.h"
 #include "conf-parser.h"
@@ -538,15 +539,7 @@ int manager_spawn_autovt(Manager *m, unsigned vtnr) {
         }
 
         xsprintf(name, "autovt@tty%u.service", vtnr);
-        r = sd_bus_call_method(
-                        m->bus,
-                        "org.freedesktop.systemd1",
-                        "/org/freedesktop/systemd1",
-                        "org.freedesktop.systemd1.Manager",
-                        "StartUnit",
-                        &error,
-                        NULL,
-                        "ss", name, "fail");
+        r = bus_call_method(m->bus, bus_systemd_mgr, "StartUnit", &error, NULL, "ss", name, "fail");
         if (r < 0)
                 return log_error_errno(r, "Failed to start %s: %s", name, bus_error_message(&error, r));