xserver: Branch 'master' - 4 commits

Peter Hutterer whot at kemper.freedesktop.org
Mon Jan 28 14:51:02 PST 2008


 config/dbus-core.c |    5 +++--
 config/dbus.c      |    5 ++---
 config/hal.c       |   17 ++++++++++-------
 3 files changed, 15 insertions(+), 12 deletions(-)

New commits:
commit 975ab11799c819a81da1dfe83505194410dbcb95
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Sat Jan 26 09:39:54 2008 +1030

    config: don't reset connection info on disconnect.
    
    If dbus is restarted, we try to connect again and this is difficult if the
    busname and/or busobject is not set.
    (cherry picked from commit 210eeef495770c1883c842ff003c28ce25f279d4)

diff --git a/config/dbus.c b/config/dbus.c
index f6ac4c1..0be42af 100644
--- a/config/dbus.c
+++ b/config/dbus.c
@@ -396,9 +396,6 @@ err_start:
 static void
 disconnect_hook(void *data)
 {
-    struct connection_info *info = data;
-
-    reset_info(info);
 }
 
 #if 0
@@ -440,4 +437,6 @@ void
 config_dbus_fini(void)
 {
     config_dbus_core_remove_hook(&core_hook);
+    connection_data.busname[0] = '\0';
+    connection_data.busobject[0] = '\0';
 }
commit 7dde5a694a06efed0a9186f05d33f5be6f5dba71
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Fri Jan 25 13:54:47 2008 +1030

    config: check connection != NULL before getting dbus' dispatch status.
    
    (cherry picked from commit d23266522390a4ef7203ae7c062b2b920e45f9d7)

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 f0ba7707161b8866e6fde32d6f25be6afcdecb48
Author: Peter Hutterer <peter at cs.unisa.edu.au>
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.
    (cherry picked from commit fb07fab2c07e7b0834724541dc47bfba02ba8574)

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 2cb0ebec2b85d96289c23c17cfdcdf97ef6877d2
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Fri Jan 25 11:48:13 2008 +1030

    config: add a debug message, fix a whitespace error.
    
    (cherry picked from commit 7732898aaa70e076000f6e6aa9420482896ed996)

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;
     }


More information about the xorg-commit mailing list