summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>2015-12-11 11:43:11 -0200
committerAdam Jackson <ajax@redhat.com>2016-02-08 15:04:20 -0500
commitedd443f69ea385a957b8eae0b066ad8e77fb947b (patch)
treefd6db05c1c913a8758078b7e45027c85bbc834f0
parent0b80da0d18713df4712c05973388b6226bb0227f (diff)
kdrive: don't let evdev driver overwrite existing device names
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>
-rw-r--r--hw/kdrive/linux/evdev.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/kdrive/linux/evdev.c b/hw/kdrive/linux/evdev.c
index 63e840996..cdd45e786 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);