rpms/xorg-x11-server/devel xserver-1.5.2-no-duplicate-devices.patch, NONE, 1.1 xorg-x11-server.spec, 1.370, 1.371

Dave Airlie airlied at fedoraproject.org
Mon Oct 20 03:33:36 UTC 2008


Author: airlied

Update of /cvs/pkgs/rpms/xorg-x11-server/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv11156

Modified Files:
	xorg-x11-server.spec 
Added Files:
	xserver-1.5.2-no-duplicate-devices.patch 
Log Message:
- xserver-1.5.2-no-duplicate-devices.patch: don't re-add devices through HAL
  if they are already added (#467462).


xserver-1.5.2-no-duplicate-devices.patch:

--- NEW FILE xserver-1.5.2-no-duplicate-devices.patch ---
>From a4e9b92e2449b4c8f8654a0eaf0f1ca6627da1fc Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer at redhat.com>
Date: Mon, 20 Oct 2008 12:19:55 +1030
Subject: [PATCH] config: don't add duplicate devices through HAL.

If HAL is restarted, the device list is send to the server again, leading
first to duplicate devices (and thus duplicate events), and later to a
FatalError "Too many input devices."

dev->config_info contains the UDI for the device. If the UDI of a new devices
is equal to one we already have in the device list, just ignore it.
---
 config/hal.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/config/hal.c b/config/hal.c
index 0e0505b..639e0ec 100644
--- a/config/hal.c
+++ b/config/hal.c
@@ -166,6 +166,26 @@ get_prop_string_array(LibHalContext *hal_ctx, const char *udi, const char *prop)
     return ret;
 }
 
+static BOOL
+device_is_duplicate(char *config_info)
+{
+    DeviceIntPtr dev;
+
+    for (dev = inputInfo.devices; dev; dev = dev->next)
+    {
+        if (dev->config_info && (strcmp(dev->config_info, config_info) == 0))
+            return TRUE;
+    }
+
+    for (dev = inputInfo.off_devices; dev; dev = dev->next)
+    {
+        if (dev->config_info && (strcmp(dev->config_info, config_info) == 0))
+            return TRUE;
+    }
+
+    return FALSE;
+}
+
 static void
 device_added(LibHalContext *hal_ctx, const char *udi)
 {
@@ -227,6 +247,13 @@ device_added(LibHalContext *hal_ctx, const char *udi)
     }
     sprintf(config_info, "hal:%s", udi);
 
+    /* Check for duplicate devices */
+    if (device_is_duplicate(config_info))
+    {
+        LogMessage(X_WARNING, "config/hal: device %s already added. Ignoring.\n", name);
+        goto unwind;
+    }
+
     /* ok, grab options from hal.. iterate through all properties
     * and lets see if any of them are options that we can add */
     set = libhal_device_get_all_properties(hal_ctx, udi, &error);
-- 
1.6.0.1



Index: xorg-x11-server.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-server/devel/xorg-x11-server.spec,v
retrieving revision 1.370
retrieving revision 1.371
diff -u -r1.370 -r1.371
--- xorg-x11-server.spec	19 Oct 2008 07:53:35 -0000	1.370
+++ xorg-x11-server.spec	20 Oct 2008 03:33:05 -0000	1.371
@@ -19,7 +19,7 @@
 Summary:   X.Org X11 X server
 Name:      xorg-x11-server
 Version:   1.5.2
-Release:   6%{?dist}
+Release:   7%{?dist}
 URL:       http://www.x.org
 License:   MIT
 Group:     User Interface/X
@@ -90,6 +90,7 @@
 # No evdev grab, disable kbd/mouse
 Patch6008: xserver-1.5.2-enable-RAW-console.patch
 Patch6009: xserver-1.5.2-disable-kbd-mouse.patch
+Patch6010: xserver-1.5.2-no-duplicate-devices.patch
 
 %define moduledir	%{_libdir}/xorg/modules
 %define drimoduledir	%{_libdir}/dri
@@ -521,6 +522,10 @@
 
 
 %changelog
+* Mon Oct 20 2008 Peter Hutterer <peter.hutterer at redhat.com> 1.5.2-7
+- xserver-1.5.2-no-duplicate-devices.patch: don't re-add devices through HAL
+  if they are already added (#467462).
+
 * Sun Oct 19 2008 Peter Hutterer <peter.hutterer at redhat.com> 1.5.2-6
 - Update xserver-1.5.2-disable-kbd-mouse.patch: if no config file is present,
   we need to force AllowEmptyInput on.




More information about the fedora-extras-commits mailing list