summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2008-07-14 10:20:11 +0930
committerPeter Hutterer <peter.hutterer@who-t.net>2008-07-14 10:20:11 +0930
commit11ee0ae9390a608a232ff94abcc0cbcf9ed7b70a (patch)
tree9509c9067303149f4931924064a438af9b20be07
parent5bcc45e07e8726a5442567472dd29cfb5c901f2d (diff)
xfree86: append, not prepent, new input devices to xf86InputDevs.
If devices are prepended to the list, their wake-up order on resume is not the same as the original initialisation order. Hot-plugged devices, originally inited last, are re-enabled before the xorg.conf devices and in some cases may steal the device files. Result: we have different devices before and after suspend/resume. RedHat Bug 439386 <https://bugzilla.redhat.com/show_bug.cgi?id=439386>
-rw-r--r--hw/xfree86/common/xf86Helper.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index d58ce9326..41181b066 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -308,12 +308,11 @@ xf86AllocateScrnInfoPrivateIndex(void)
return idx;
}
-/* Allocate a new InputInfoRec and add it to the head xf86InputDevs. */
-
+/* Allocate a new InputInfoRec and append it to the tail of xf86InputDevs. */
_X_EXPORT InputInfoPtr
xf86AllocateInput(InputDriverPtr drv, int flags)
{
- InputInfoPtr new;
+ InputInfoPtr new, *prev = NULL;
if (!(new = xcalloc(sizeof(InputInfoRec), 1)))
return NULL;
@@ -321,8 +320,13 @@ xf86AllocateInput(InputDriverPtr drv, int flags)
new->drv = drv;
drv->refCount++;
new->module = DuplicateModule(drv->module, NULL);
- new->next = xf86InputDevs;
- xf86InputDevs = new;
+
+ for (prev = &xf86InputDevs; *prev; prev = &(*prev)->next)
+ ;
+
+ *prev = new;
+ new->next = NULL;
+
return new;
}