From ba0d3d490fa772d00e8f4a0dda34c858de00e16f Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sun, 13 Oct 2024 13:17:26 +0900 Subject: busctl: show information of passed file descriptor --- src/busctl/busctl.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/busctl') diff --git a/src/busctl/busctl.c b/src/busctl/busctl.c index 49ba7baa06..1e352a3729 100644 --- a/src/busctl/busctl.c +++ b/src/busctl/busctl.c @@ -21,6 +21,7 @@ #include "fileio.h" #include "format-table.h" #include "glyph-util.h" +#include "json-util.h" #include "log.h" #include "main-func.h" #include "memstream-util.h" @@ -2008,16 +2009,19 @@ static int json_transform_one(sd_bus_message *m, sd_json_variant **ret) { break; } - case SD_BUS_TYPE_UNIX_FD: - r = sd_bus_message_read_basic(m, type, NULL); + case SD_BUS_TYPE_UNIX_FD: { + int fd; + + r = sd_bus_message_read_basic(m, type, &fd); if (r < 0) return bus_log_parse_error(r); - r = sd_json_variant_new_null(&v); + r = json_variant_new_fd_info(&v, fd); if (r < 0) return log_error_errno(r, "Failed to transform fd: %m"); break; + } case SD_BUS_TYPE_ARRAY: case SD_BUS_TYPE_VARIANT: -- cgit v1.2.3