From: Daan De Meyer Date: Thu, 16 Oct 2025 17:06:46 +0000 (+0200) Subject: implement ExecContext for io.systemd.Unit.List (#38212) X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=06d73c50468c689bc2168ef9289fb145d519272c;p=thirdparty%2Fsystemd.git implement ExecContext for io.systemd.Unit.List (#38212) --- 06d73c50468c689bc2168ef9289fb145d519272c diff --cc src/core/varlink-common.c index 6a1e6af9ae9,37d82e3fe0f..babed68378f --- a/src/core/varlink-common.c +++ b/src/core/varlink-common.c @@@ -50,7 -50,30 +51,32 @@@ int rlimit_table_build_json(sd_json_var return r; } + *ret = TAKE_PTR(v); + return 0; } + + int cpuset_build_json(sd_json_variant **ret, const char *name, void *userdata) { + _cleanup_free_ uint8_t *array = NULL; + CPUSet *cpuset = ASSERT_PTR(userdata); + size_t allocated; + int r; + + assert(ret); + + if (!cpuset->set) + goto empty; + + r = cpu_set_to_dbus(cpuset, &array, &allocated); + if (r < 0) + return log_debug_errno(r, "Failed to serialize cpu set to dbus: %m"); + + if (allocated == 0) + goto empty; + + return sd_json_variant_new_array_bytes(ret, array, allocated); + + empty: + *ret = NULL; + return 0; + } diff --cc src/shared/securebits-util.h index dc61ecd57ea,553b717a576..6251fb7922f --- a/src/shared/securebits-util.h +++ b/src/shared/securebits-util.h @@@ -3,9 -3,10 +3,10 @@@ #include -#include "forward.h" +#include "shared-forward.h" - int secure_bits_to_string_alloc(int i, char **s); + int secure_bits_to_strv(int i, char ***ret); + int secure_bits_to_string_alloc(int i, char **ret); int secure_bits_from_string(const char *s); static inline bool secure_bits_is_valid(int i) {