0002-use-sd_bus_call_method_async-to-replace-the-asyncv-one.patch 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. From b0abedf60b40adf0f2fb3cf9dfee4bc601f7b39f Mon Sep 17 00:00:00 2001
  2. From: Chen Qi <Qi.Chen@windriver.com>
  3. Date: Thu, 25 Aug 2022 05:45:53 -0700
  4. Subject: [PATCH] use sd_bus_call_method_async to replace the asyncv one
  5. The sd_bus_call_method_asyncv's 10th parameter is of type
  6. va_list and supplying NULL when invoking it causes compilation
  7. error. Just replace it with the async one.
  8. Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
  9. [Retrieved from:
  10. https://github.com/lxc/lxc/commit/b0abedf60b40adf0f2fb3cf9dfee4bc601f7b39f]
  11. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  12. ---
  13. meson.build | 4 ++--
  14. src/lxc/cgroups/cgfsng.c | 2 +-
  15. 2 files changed, 3 insertions(+), 3 deletions(-)
  16. diff --git a/meson.build b/meson.build
  17. index 21955a0504..f8bdcf4e83 100644
  18. --- a/meson.build
  19. +++ b/meson.build
  20. @@ -295,9 +295,9 @@ if not want_sd_bus.disabled()
  21. has_sd_bus = false
  22. endif
  23. - if not cc.has_function('sd_bus_call_method_asyncv', prefix: '#include <systemd/sd-bus.h>', dependencies: libsystemd)
  24. + if not cc.has_function('sd_bus_call_method_async', prefix: '#include <systemd/sd-bus.h>', dependencies: libsystemd)
  25. if not sd_bus_optional
  26. - error('libsystemd misses required sd_bus_call_method_asyncv function')
  27. + error('libsystemd misses required sd_bus_call_method_async function')
  28. endif
  29. has_sd_bus = false
  30. diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c
  31. index 8a3615893f..d90e5385e1 100644
  32. --- a/src/lxc/cgroups/cgfsng.c
  33. +++ b/src/lxc/cgroups/cgfsng.c
  34. @@ -1232,7 +1232,7 @@ static int unpriv_systemd_create_scope(struct cgroup_ops *ops, struct lxc_conf *
  35. if (r < 0)
  36. return log_error(SYSTEMD_SCOPE_FAILED, "Failed to connect to user bus: %s", strerror(-r));
  37. - r = sd_bus_call_method_asyncv(bus, NULL, DESTINATION, PATH, INTERFACE, "Subscribe", NULL, NULL, NULL, NULL);
  38. + r = sd_bus_call_method_async(bus, NULL, DESTINATION, PATH, INTERFACE, "Subscribe", NULL, NULL, NULL);
  39. if (r < 0)
  40. return log_error(SYSTEMD_SCOPE_FAILED, "Failed to subscribe to signals: %s", strerror(-r));