commit d23266522390a4ef7203ae7c062b2b920e45f9d7 Author: Peter Hutterer Date: Fri Jan 25 13:54:47 2008 +1030 config: check connection != NULL before getting dbus' dispatch status. diff --git a/config/dbus-core.c b/config/dbus-core.c index 9cf1530..b349c6e 100644 --- a/config/dbus-core.c +++ b/config/dbus-core.c @@ -56,8 +56,9 @@ wakeup_handler(pointer data, int err, pointer read_mask) if (info->connection && FD_ISSET(info->fd, (fd_set *) read_mask)) { do { dbus_connection_read_write_dispatch(info->connection, 0); - } while (dbus_connection_get_dispatch_status(info->connection) == - DBUS_DISPATCH_DATA_REMAINS); + } while (info->connection && + dbus_connection_get_is_connected(info->connection) && + dbus_connection_get_dispatch_status(info->connection) == DBUS_DISPATCH_DATA_REMAINS); } } commit fb07fab2c07e7b0834724541dc47bfba02ba8574 Author: Peter Hutterer Date: Fri Jan 25 13:45:22 2008 +1030 config: only shutdown libhal if the connection is valid. Thanks to libdbus' extensive use of assert we won't just get an error, it'll bring the whole server down for us. diff --git a/config/hal.c b/config/hal.c index 52a0113..1575422 100644 --- a/config/hal.c +++ b/config/hal.c @@ -283,12 +283,14 @@ disconnect_hook(void *data) struct config_hal_info *info = data; if (info->hal_ctx) { - dbus_error_init(&error); - if (!libhal_ctx_shutdown(info->hal_ctx, &error)) - DebugF("[config/hal] couldn't shut down context: %s (%s)\n", - error.name, error.message); + if (dbus_connection_get_is_connected(info->system_bus)) { + dbus_error_init(&error); + if (!libhal_ctx_shutdown(info->hal_ctx, &error)) + DebugF("[config/hal] couldn't shut down context: %s (%s)\n", + error.name, error.message); + dbus_error_free(&error); + } libhal_ctx_free(info->hal_ctx); - dbus_error_free(&error); } info->hal_ctx = NULL; commit 7732898aaa70e076000f6e6aa9420482896ed996 Author: Peter Hutterer Date: Fri Jan 25 11:48:13 2008 +1030 config: add a debug message, fix a whitespace error. diff --git a/config/hal.c b/config/hal.c index 4ab2961..52a0113 100644 --- a/config/hal.c +++ b/config/hal.c @@ -105,7 +105,7 @@ get_prop_string(LibHalContext *hal_ctx, const char *udi, const char *name) char *prop, *ret; prop = libhal_device_get_property_string(hal_ctx, udi, name, NULL); - DebugF(" [config/hal] getting %s on %s returned %s\n", name, udi, prop); + DebugF("[config/hal] getting %s on %s returned %s\n", name, udi, prop); if (prop) { ret = xstrdup(prop); libhal_free_string(prop); @@ -234,8 +234,9 @@ device_added(LibHalContext *hal_ctx, const char *udi) if (xkb_options) add_option(&options, "xkb_options", xkb_options); + DebugF("[config/hal] Adding device %s\n", name); if (NewInputDeviceRequest(options, &dev) != Success) { - DebugF("[config/hal] NewInputDeviceRequest failed\n"); + ErrorF("[config/hal] NewInputDeviceRequest failed\n"); dev = NULL; goto unwind; }