summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2007-08-01 02:54:14 +0300
committerDaniel Stone <daniel@fooishbar.org>2007-08-01 03:33:05 +0300
commit0a31db14b7c7c21ef550dbcc73a9f649f3613cbe (patch)
tree68737f9e3d72303dd0736afa4da3cc6be36a9a45 /config
parent89f628394f7d831f2ba1e45c5884c3983bef6031 (diff)
Config: D-Bus core: Fix hook removal
Make sure we properly initialise the entire hook when adding it, and bust out when we're done removing.
Diffstat (limited to 'config')
-rw-r--r--config/dbus-core.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/config/dbus-core.c b/config/dbus-core.c
index 008e21a98..28881596f 100644
--- a/config/dbus-core.c
+++ b/config/dbus-core.c
@@ -200,6 +200,8 @@ config_dbus_core_add_hook(struct config_dbus_core_hook *hook)
for (prev = &bus_info.hooks; *prev; prev = &(*prev)->next)
;
+
+ hook->next = NULL;
*prev = hook;
/* If we're already connected, call the connect hook. */
@@ -215,8 +217,10 @@ config_dbus_core_remove_hook(struct config_dbus_core_hook *hook)
struct config_dbus_core_hook **prev;
for (prev = &bus_info.hooks; *prev; prev = &(*prev)->next) {
- if (*prev == hook)
+ if (*prev == hook) {
*prev = hook->next;
+ break;
+ }
}
}