summaryrefslogtreecommitdiff
path: root/bus/bus.c
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2010-02-01 17:27:26 -0500
committerColin Walters <walters@verbum.org>2010-02-01 17:27:26 -0500
commit6db588b8544e117241a3be2c595dfc8fdcdc8f59 (patch)
tree7fc15cf9939edecf76d9cfd4163560bc9bc22363 /bus/bus.c
parent2016b83dece7f220269033e7957fb02140334294 (diff)
parente59db9df47bcf99aa292e6d13ca2044105a94b90 (diff)
downloaddbus-6db588b8544e117241a3be2c595dfc8fdcdc8f59.tar.gz
Merge branch 'my-dbus-1.2'
Diffstat (limited to 'bus/bus.c')
-rw-r--r--bus/bus.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/bus/bus.c b/bus/bus.c
index 0bb9ffa4..c748353e 100644
--- a/bus/bus.c
+++ b/bus/bus.c
@@ -527,11 +527,6 @@ process_config_every_time (BusContext *context,
goto failed;
}
- /* Drop existing conf-dir watches (if applicable) */
-
- if (is_reload)
- bus_drop_all_directory_watches ();
-
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
retval = TRUE;
@@ -562,13 +557,17 @@ process_config_postinit (BusContext *context,
_dbus_hash_table_unref (service_context_table);
/* Watch all conf directories */
- _dbus_list_foreach (bus_config_parser_get_conf_dirs (parser),
- (DBusForeachFunction) bus_watch_directory,
- context);
+ bus_set_watched_dirs (context, bus_config_parser_get_conf_dirs (parser));
return TRUE;
}
+static void
+bus_shutdown_all_directory_watches (void *data)
+{
+ bus_set_watched_dirs ((BusContext *) data, NULL);
+}
+
BusContext*
bus_context_new (const DBusString *config_file,
ForceForkSetting force_fork,
@@ -599,7 +598,9 @@ bus_context_new (const DBusString *config_file,
context->refcount = 1;
_dbus_generate_uuid (&context->uuid);
-
+
+ _dbus_register_shutdown_func (bus_shutdown_all_directory_watches, context);
+
if (!_dbus_string_copy_data (config_file, &context->config_file))
{
BUS_SET_OOM (error);