chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sd-bus: sync kdbus.h (ABI break)
[elogind.git]
/
src
/
libsystemd
/
sd-bus
/
bus-match.c
diff --git
a/src/libsystemd/sd-bus/bus-match.c
b/src/libsystemd/sd-bus/bus-match.c
index b868159b5c8233fd49e30650d3d74fe15f40e306..18afe0f12a0e96d585b8a29e81b3ff3a70cc01ec 100644
(file)
--- a/
src/libsystemd/sd-bus/bus-match.c
+++ b/
src/libsystemd/sd-bus/bus-match.c
@@
-289,17
+289,22
@@
int bus_match_run(
return r;
/* Run the callback. And then invoke siblings. */
return r;
/* Run the callback. And then invoke siblings. */
- if (node->leaf.callback) {
- sd_bus_slot *slot;
-
+ if (node->leaf.callback->callback) {
_cleanup_bus_error_free_ sd_bus_error error_buffer = SD_BUS_ERROR_NULL;
_cleanup_bus_error_free_ sd_bus_error error_buffer = SD_BUS_ERROR_NULL;
+ sd_bus_slot *slot;
slot = container_of(node->leaf.callback, sd_bus_slot, match_callback);
slot = container_of(node->leaf.callback, sd_bus_slot, match_callback);
- if (bus)
- bus->current_slot = slot;
+ if (bus) {
+ bus->current_slot = sd_bus_slot_ref(slot);
+ bus->current_handler = node->leaf.callback->callback;
+ bus->current_userdata = slot->userdata;
+ }
r = node->leaf.callback->callback(bus, m, slot->userdata, &error_buffer);
r = node->leaf.callback->callback(bus, m, slot->userdata, &error_buffer);
- if (bus)
- bus->current_slot = NULL;
+ if (bus) {
+ bus->current_userdata = NULL;
+ bus->current_handler = NULL;
+ bus->current_slot = sd_bus_slot_unref(slot);
+ }
r = bus_maybe_reply_error(m, r, &error_buffer);
if (r != 0)
r = bus_maybe_reply_error(m, r, &error_buffer);
if (r != 0)
@@
-445,13
+450,13
@@
static int bus_match_add_compare_value(
where->child = c;
if (t == BUS_MATCH_MESSAGE_TYPE) {
where->child = c;
if (t == BUS_MATCH_MESSAGE_TYPE) {
- c->compare.children = hashmap_new(
trivial_hash_func, trivial_compare_func
);
+ c->compare.children = hashmap_new(
NULL
);
if (!c->compare.children) {
r = -ENOMEM;
goto fail;
}
} else if (BUS_MATCH_CAN_HASH(t)) {
if (!c->compare.children) {
r = -ENOMEM;
goto fail;
}
} else if (BUS_MATCH_CAN_HASH(t)) {
- c->compare.children = hashmap_new(
string_hash_func, string_compare_func
);
+ c->compare.children = hashmap_new(
&string_hash_ops
);
if (!c->compare.children) {
r = -ENOMEM;
goto fail;
if (!c->compare.children) {
r = -ENOMEM;
goto fail;