summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-kernel.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-12-12 01:42:41 +0100
committerLennart Poettering <lennart@poettering.net>2013-12-12 01:51:51 +0100
commitd78bf250b0e31b42eb8b86ebe3ee775b247bfcf8 (patch)
treecb82213cc656544e035c2576599ab0588637d020 /src/libsystemd-bus/bus-kernel.c
parent689bd78d108819b362e75af42536725c56b5e939 (diff)
bus: properly generate NameOwnerChanged messages when we take from/give back to queue/starter
Diffstat (limited to 'src/libsystemd-bus/bus-kernel.c')
-rw-r--r--src/libsystemd-bus/bus-kernel.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/libsystemd-bus/bus-kernel.c b/src/libsystemd-bus/bus-kernel.c
index 92acbeec5e..81dfba7476 100644
--- a/src/libsystemd-bus/bus-kernel.c
+++ b/src/libsystemd-bus/bus-kernel.c
@@ -514,17 +514,18 @@ static int translate_name_change(sd_bus *bus, struct kdbus_msg *k, struct kdbus_
assert(k);
assert(d);
- if (d->name_change.flags & (KDBUS_NAME_IN_QUEUE|KDBUS_NAME_STARTER))
- return 0;
-
- if (d->type == KDBUS_ITEM_NAME_ADD)
+ if (d->type == KDBUS_ITEM_NAME_ADD || (d->name_change.old_flags & (KDBUS_NAME_IN_QUEUE|KDBUS_NAME_STARTER)))
old_owner[0] = 0;
else
sprintf(old_owner, ":1.%llu", (unsigned long long) d->name_change.old_id);
- if (d->type == KDBUS_ITEM_NAME_REMOVE)
+ if (d->type == KDBUS_ITEM_NAME_REMOVE || (d->name_change.new_flags & (KDBUS_NAME_IN_QUEUE|KDBUS_NAME_STARTER))) {
+
+ if (isempty(old_owner))
+ return 0;
+
new_owner[0] = 0;
- else
+ } else
sprintf(new_owner, ":1.%llu", (unsigned long long) d->name_change.new_id);
return push_name_owner_changed(bus, d->name_change.name, old_owner, new_owner);