summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-10-11 13:40:50 -0400
committerGitHub <noreply@github.com>2016-10-11 13:40:50 -0400
commitb744e8937ce603090a9bf64ac7d8cc2c1a29e4f0 (patch)
treed6873059fd870c78dae268671ad0e12ac8c493db /src/shared
parent40f45ff0c339971fd088e6f9cc2e61444087685d (diff)
parenta46eac1bbddcdd15e741fc6c8389078db1067f81 (diff)
Merge pull request #4067 from poettering/invocation-id
Add an "invocation ID" concept to the service manager
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/bus-util.c17
-rw-r--r--src/shared/bus-util.h1
2 files changed, 18 insertions, 0 deletions
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c
index e2a216a5cc..bb90c89cc2 100644
--- a/src/shared/bus-util.c
+++ b/src/shared/bus-util.c
@@ -1324,6 +1324,23 @@ int bus_property_get_bool(
return sd_bus_message_append_basic(reply, 'b', &b);
}
+int bus_property_get_id128(
+ sd_bus *bus,
+ const char *path,
+ const char *interface,
+ const char *property,
+ sd_bus_message *reply,
+ void *userdata,
+ sd_bus_error *error) {
+
+ sd_id128_t *id = userdata;
+
+ if (sd_id128_is_null(*id)) /* Add an empty array if the ID is zero */
+ return sd_bus_message_append(reply, "ay", 0);
+ else
+ return sd_bus_message_append_array(reply, 'y', id->bytes, 16);
+}
+
#if __SIZEOF_SIZE_T__ != 8
int bus_property_get_size(
sd_bus *bus,
diff --git a/src/shared/bus-util.h b/src/shared/bus-util.h
index db6b1acba2..934e0b5b77 100644
--- a/src/shared/bus-util.h
+++ b/src/shared/bus-util.h
@@ -79,6 +79,7 @@ int bus_print_property(const char *name, sd_bus_message *property, bool value, b
int bus_print_all_properties(sd_bus *bus, const char *dest, const char *path, char **filter, bool value, bool all);
int bus_property_get_bool(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *error);
+int bus_property_get_id128(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *error);
#define bus_property_get_usec ((sd_bus_property_get_t) NULL)
#define bus_property_set_usec ((sd_bus_property_set_t) NULL)