diff options
author | Colin Walters <walters@verbum.org> | 2010-02-22 09:48:45 -0500 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2010-02-22 09:48:45 -0500 |
commit | e1c31c73074513d96fa22b5c0355107c42720597 (patch) | |
tree | e1216637b5f52540e279f0f1f3ef9662c4437978 /bus/bus.c | |
parent | 235eebdb1618ecdd0f752c9bcd92c61d17752e0b (diff) | |
parent | fbeb13517ef667b8ed4136bcb9e52ff9924419c1 (diff) | |
download | dbus-e1c31c73074513d96fa22b5c0355107c42720597.tar.gz |
Merge branch 'dbus-1.2'
Conflicts:
bus/bus.c
bus/selinux.c
configure.in
Diffstat (limited to 'bus/bus.c')
-rw-r--r-- | bus/bus.c | 44 |
1 files changed, 42 insertions, 2 deletions
@@ -540,11 +540,39 @@ process_config_every_time (BusContext *context, } static dbus_bool_t +list_concat_new (DBusList **a, + DBusList **b, + DBusList **result) +{ + DBusList *link; + + *result = NULL; + + link = _dbus_list_get_first_link (a); + for (link = _dbus_list_get_first_link (a); link; link = _dbus_list_get_next_link (a, link)) + { + if (!_dbus_list_append (result, link->data)) + goto oom; + } + for (link = _dbus_list_get_first_link (b); link; link = _dbus_list_get_next_link (b, link)) + { + if (!_dbus_list_append (result, link->data)) + goto oom; + } + + return TRUE; +oom: + _dbus_list_clear (result); + return FALSE; +} + +static dbus_bool_t process_config_postinit (BusContext *context, BusConfigParser *parser, DBusError *error) { DBusHashTable *service_context_table; + DBusList *watched_dirs = NULL; service_context_table = bus_config_parser_steal_service_context_table (parser); if (!bus_registry_set_service_context_table (context->registry, @@ -556,8 +584,20 @@ process_config_postinit (BusContext *context, _dbus_hash_table_unref (service_context_table); - /* Watch all conf directories */ - bus_set_watched_dirs (context, bus_config_parser_get_conf_dirs (parser)); + /* We need to monitor both the configuration directories and directories + * containing .service files. + */ + if (!list_concat_new (bus_config_parser_get_conf_dirs (parser), + bus_config_parser_get_service_dirs (parser), + &watched_dirs)) + { + BUS_SET_OOM (error); + return FALSE; + } + + bus_set_watched_dirs (context, &watched_dirs); + + _dbus_list_clear (&watched_dirs); return TRUE; } |