]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-json: encode pidref fd_id as unsigned
authorEric Boucher <bouchereric0000@hotmail.com>
Mon, 27 Apr 2026 01:04:07 +0000 (21:04 -0400)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 2 Aug 2026 05:14:46 +0000 (14:14 +0900)
PidRef.fd_id is uint64_t.

src/libsystemd/sd-json/json-util.c

index 6cbb61cb5e300e4de7ec2ac5548bffb3909eb37c..76d882e3fbb356d861cab9c5f93f47579a7de911 100644 (file)
@@ -499,7 +499,7 @@ int json_variant_new_pidref(sd_json_variant **ret, PidRef *pidref) {
         return sd_json_buildo(
                         ret,
                         SD_JSON_BUILD_PAIR_INTEGER("pid", pidref->pid),
-                        SD_JSON_BUILD_PAIR_CONDITION(pidref->fd_id > 0, "pidfdId", SD_JSON_BUILD_INTEGER(pidref->fd_id)),
+                        SD_JSON_BUILD_PAIR_CONDITION(pidref->fd_id > 0, "pidfdId", SD_JSON_BUILD_UNSIGNED(pidref->fd_id)),
                         SD_JSON_BUILD_PAIR_CONDITION(!sd_id128_is_null(boot_id), "bootId", SD_JSON_BUILD_ID128(boot_id)));
 }