[PATCH v5 RESEND RFC 10/10] kdrive: don't let evdev driver overwrite existing device names

Laércio de Sousa laerciosousa at sme-mogidascruzes.sp.gov.br
Mon Aug 24 05:45:02 PDT 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.5.0



More information about the xorg-devel mailing list