dbus/bus bus.c,1.64,1.65
David Zeuthen
david at freedesktop.org
Mon Nov 14 12:51:27 PST 2005
Update of /cvs/dbus/dbus/bus
In directory gabe:/tmp/cvs-serv32588/bus
Modified Files:
bus.c
Log Message:
2005-11-14 David Zeuthen <davidz at redhat.com>
Patch from Timo Hoenig <thoenig at suse.de>.
* bus/bus.c: I've recently investigated why the automatic reload
of configuration files does not work as expected.
Currently, reloading configuration files does only work when
running dbus-daemon with --nodaemon. If we are running as daemon
we're hitting a dnotify bug once we fork the process.
We're initializing the dnotify fds before calling fork(). Once
the child process forked it does still have the fds (and they
still show up in /proc/`pidof dbus-daemon`/fd/) but we're not
getting SIGIO as changes are made to the configuration files.
The attached patch moves the initialization of the dnotify fds to
process_config_postinit(). This is safe for all current code
paths and solves the dnotify disfunction. If we're running
dbus-daemon as daemon the fds for dnotify are now being
initialized after fork() for the child process.
* configure.in: The current configure.in check for dnotify probes
'x$target_os' for being 'xlinux-gnu'. I've changed the check to
match for 'xlinux', too. Additionally I have adapted the configure
option's style to match with the others.
Index: bus.c
===================================================================
RCS file: /cvs/dbus/dbus/bus/bus.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- bus.c 16 Jun 2005 06:05:09 -0000 1.64
+++ bus.c 14 Nov 2005 20:51:25 -0000 1.65
@@ -479,15 +479,11 @@
goto failed;
}
- /* Drop existing conf-dir watches (if applicable) and watch all conf directories */
+ /* Drop existing conf-dir watches (if applicable) */
if (is_reload)
bus_drop_all_directory_watches ();
- _dbus_list_foreach (bus_config_parser_get_conf_dirs (parser),
- (DBusForeachFunction) bus_watch_directory,
- NULL);
-
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
retval = TRUE;
@@ -497,9 +493,9 @@
}
static dbus_bool_t
-process_config_postinit (BusContext *context,
+process_config_postinit (BusContext *context,
BusConfigParser *parser,
- DBusError *error)
+ DBusError *error)
{
DBusHashTable *service_context_table;
@@ -512,6 +508,12 @@
}
_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,
+ NULL);
+
return TRUE;
}
More information about the dbus-commit
mailing list