summaryrefslogtreecommitdiffstats
path: root/src/busctl
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2024-10-13 06:17:26 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2024-10-15 12:09:38 +0200
commitba0d3d490fa772d00e8f4a0dda34c858de00e16f (patch)
tree8b8fbb4edce42c29e41b4fccd8335ae26f68f297 /src/busctl
parentsd-json: introduce json_variant_new_fd_info() (diff)
downloadsystemd-ba0d3d490fa772d00e8f4a0dda34c858de00e16f.tar.xz
systemd-ba0d3d490fa772d00e8f4a0dda34c858de00e16f.zip
busctl: show information of passed file descriptor
Diffstat (limited to 'src/busctl')
-rw-r--r--src/busctl/busctl.c10
1 files changed, 7 insertions, 3 deletions
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: