---
src/machine/machinectl.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c
index ba0ceb7..5731247 100644
--- a/src/machine/machinectl.c
+++ b/src/machine/machinectl.c
@@ -334,6 +334,21 @@ static int print_property(const char *name, sd_bus_message
*reply) {
return 0;
}
+static int sd_bus_message_enter_unknown_container(sd_bus_message *message,
char type) {
+ const char *contents;
+ int r;
+
+ r = sd_bus_message_peek_type(reply, NULL, &contents);
+ if (r < 0)
+ return r;
+
+ r = sd_bus_message_enter_contanire(reply, type, contents);
+ if (r < 0)
+ return r;
+
+ return 0;
+}
+
static int show_one(const char *verb, sd_bus *bus, const char *path, bool
show_properties, bool *new_line) {
_cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
@@ -378,11 +393,7 @@ static int show_one(const char *verb, sd_bus *bus, const
char *path, bool show_p
if (r < 0)
goto fail;
- r = sd_bus_message_peek_type(reply, NULL, &contents);
- if (r < 0)
- goto fail;
-
- r = sd_bus_message_enter_container(reply, SD_BUS_TYPE_VARIANT,
contents);
+ r = sd_bus_message_enter_unknown_container(reply,
SD_BUS_TYPE_VARIANT);
if (r < 0)
goto fail;
--
1.8.4.1
_______________________________________________
systemd-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/systemd-devel