forked from pool/xorg-x11-server
48 lines
1.3 KiB
Diff
48 lines
1.3 KiB
Diff
|
From edd443f69ea385a957b8eae0b066ad8e77fb947b Mon Sep 17 00:00:00 2001
|
||
|
From: =?UTF-8?q?La=C3=A9rcio=20de=20Sousa?=
|
||
|
<laerciosousa@sme-mogidascruzes.sp.gov.br>
|
||
|
Date: Fri, 11 Dec 2015 11:43:11 -0200
|
||
|
Subject: [PATCH 02/56] kdrive: don't let evdev driver overwrite existing
|
||
|
device names
|
||
|
MIME-Version: 1.0
|
||
|
Content-Type: text/plain; charset=UTF-8
|
||
|
Content-Transfer-Encoding: 8bit
|
||
|
|
||
|
KDrive evdev driver deliberately name grabbed devices as "Evdev mouse"
|
||
|
or "Evdev keyboard". This patch will make it skip this step if grabbed
|
||
|
devices are already named (i.e. from udev).
|
||
|
|
||
|
Reviewed-by: Adam Jackson <ajax@redhat.com>
|
||
|
Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
|
||
|
---
|
||
|
hw/kdrive/linux/evdev.c | 6 ++++--
|
||
|
1 file changed, 4 insertions(+), 2 deletions(-)
|
||
|
|
||
|
diff --git a/hw/kdrive/linux/evdev.c b/hw/kdrive/linux/evdev.c
|
||
|
index 63e8409..cdd45e7 100644
|
||
|
--- a/hw/kdrive/linux/evdev.c
|
||
|
+++ b/hw/kdrive/linux/evdev.c
|
||
|
@@ -220,7 +220,8 @@ EvdevPtrInit(KdPointerInfo * pi)
|
||
|
|
||
|
close(fd);
|
||
|
|
||
|
- pi->name = strdup("Evdev mouse");
|
||
|
+ if (!pi->name)
|
||
|
+ pi->name = strdup("Evdev mouse");
|
||
|
|
||
|
return Success;
|
||
|
}
|
||
|
@@ -390,7 +391,8 @@ EvdevKbdInit(KdKeyboardInfo * ki)
|
||
|
|
||
|
close(fd);
|
||
|
|
||
|
- ki->name = strdup("Evdev keyboard");
|
||
|
+ if (!ki->name)
|
||
|
+ ki->name = strdup("Evdev keyboard");
|
||
|
|
||
|
readMapping(ki);
|
||
|
|
||
|
--
|
||
|
2.6.2
|
||
|
|