[PATCH kdrive/ephyr v7 6/9] kdrive: don't let evdev driver overwrite existing device names

Laércio de Sousa laerciosousa at sme-mogidascruzes.sp.gov.br
Fri Dec 11 05:43:11 PST 2015


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).

Signed-off-by: Laércio de Sousa <laerciosousa at 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 fecbae4..57a6dbf 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.1.4



More information about the xorg-devel mailing list