]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: replace usage of sd_bus_call_method_async() to bus_call_method_async() ...
authorwilliamsumendap <110759212+williamsumendap@users.noreply.github.com>
Fri, 12 Aug 2022 18:28:29 +0000 (11:28 -0700)
committerGitHub <noreply@github.com>
Fri, 12 Aug 2022 18:28:29 +0000 (03:28 +0900)
src/network/networkd-dhcp-common.c
src/network/networkd-manager.c
src/shared/bus-locator.c
src/shared/bus-locator.h

index ce5262fcd6907c8337c98c1204004f4095bb024a..94771278855ed748a385afe1eb31f69825740e8b 100644 (file)
@@ -4,6 +4,7 @@
 #include <linux/if_arp.h>
 
 #include "bus-error.h"
+#include "bus-locator.h"
 #include "dhcp-identifier.h"
 #include "dhcp-internal.h"
 #include "dhcp6-internal.h"
@@ -187,12 +188,10 @@ int manager_request_product_uuid(Manager *m) {
 
         m->product_uuid_requested = false;
 
-        r = sd_bus_call_method_async(
+        r = bus_call_method_async(
                         m->bus,
                         NULL,
-                        "org.freedesktop.hostname1",
-                        "/org/freedesktop/hostname1",
-                        "org.freedesktop.hostname1",
+                        bus_hostname,
                         "GetProductUUID",
                         get_product_uuid_handler,
                         m,
index fe0a739410677909bd49f80e4eeec9b12f6a0017..9b77f536c8e9f3b4224571e615f3e8f8b78c9a78 100644 (file)
@@ -993,12 +993,10 @@ int manager_set_hostname(Manager *m, const char *hostname) {
                 return 0;
         }
 
-        r = sd_bus_call_method_async(
+        r = bus_call_method_async(
                         m->bus,
                         NULL,
-                        "org.freedesktop.hostname1",
-                        "/org/freedesktop/hostname1",
-                        "org.freedesktop.hostname1",
+                        bus_hostname,
                         "SetHostname",
                         set_hostname_handler,
                         m,
index 3754d1dd68c88bac49f31f5a1890ce1d85b12bf9..5b9a6dbc438f681e5e817b361a8487206939ed88 100644 (file)
@@ -63,6 +63,12 @@ const BusLocator* const bus_timedate = &(BusLocator){
         .interface = "org.freedesktop.timedate1"
 };
 
+const BusLocator* const bus_hostname = &(BusLocator){
+        .destination = "org.freedesktop.hostname1",
+        .path = "/org/freedesktop/hostname1",
+        .interface = "org.freedesktop.hostname1"
+};
+
 /* Shorthand flavors of the sd-bus convenience helpers with destination,path,interface strings encapsulated
  * within a single struct. */
 int bus_call_method_async(
index fe3b8765279312d25d234f06f30049ed5a4d675d..9662c906e18d72fba31952cd138ff30d4b3fdb6a 100644 (file)
@@ -19,6 +19,7 @@ extern const BusLocator* const bus_portable_mgr;
 extern const BusLocator* const bus_resolve_mgr;
 extern const BusLocator* const bus_systemd_mgr;
 extern const BusLocator* const bus_timedate;
+extern const BusLocator* const bus_hostname;
 
 /* Shorthand flavors of the sd-bus convenience helpers with destination,path,interface strings encapsulated
  * within a single struct. */