summaryrefslogtreecommitdiff
path: root/src/shared/bus-util.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-04-17 23:37:52 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-04-17 23:37:52 +0900
commit0ddf50ffcbd5ed4d406264c23c23df4e76bc253c (patch)
tree32f7ed05eb62342e83836e95ee88c7d698eec4dc /src/shared/bus-util.c
parent2cb36f7c1e4672df2b47bffab3b7d65216915992 (diff)
downloadsystemd-0ddf50ffcbd5ed4d406264c23c23df4e76bc253c.tar.gz
bus-util: introduce bus_open_system_watch_bind_with_description()
Similar to 56fbd7187a5af44a90c258fbeb1f17114f226bb3, this adds bus_open_system_watch_bind_with_description() to set description for busses.
Diffstat (limited to 'src/shared/bus-util.c')
-rw-r--r--src/shared/bus-util.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c
index 10f047026e..a14e87d1ba 100644
--- a/src/shared/bus-util.c
+++ b/src/shared/bus-util.c
@@ -1657,7 +1657,7 @@ int bus_track_add_name_many(sd_bus_track *t, char **l) {
return r;
}
-int bus_open_system_watch_bind(sd_bus **ret) {
+int bus_open_system_watch_bind_with_description(sd_bus **ret, const char *description) {
_cleanup_(sd_bus_unrefp) sd_bus *bus = NULL;
const char *e;
int r;
@@ -1670,6 +1670,12 @@ int bus_open_system_watch_bind(sd_bus **ret) {
if (r < 0)
return r;
+ if (description) {
+ r = sd_bus_set_description(bus, description);
+ if (r < 0)
+ return r;
+ }
+
e = secure_getenv("DBUS_SYSTEM_BUS_ADDRESS");
if (!e)
e = DEFAULT_SYSTEM_BUS_ADDRESS;