summaryrefslogtreecommitdiff
path: root/src/eventcomm.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-03-08 10:41:14 +0100
committerPeter Hutterer <peter.hutterer@who-t.net>2014-03-11 14:59:15 +1000
commit80efc2f54f11a4d45411951f7055bfec2ed40fee (patch)
tree330408cc3a9227fd11ba686411049dabc5843634 /src/eventcomm.c
parentc431d900f54696f608312ea51b1fa671839f7d42 (diff)
synaptics: Add support for server managed fds
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/eventcomm.c')
-rw-r--r--src/eventcomm.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/eventcomm.c b/src/eventcomm.c
index 2bbf411..fb4181e 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -931,7 +931,11 @@ EventAutoDevProbe(InputInfoPtr pInfo, const char *device)
if (device) {
int fd = -1;
- SYSCALL(fd = open(device, O_RDONLY));
+ if (pInfo->flags & XI86_SERVER_FD)
+ fd = pInfo->fd;
+ else
+ SYSCALL(fd = open(device, O_RDONLY));
+
if (fd >= 0) {
int rc;
struct libevdev *evdev;
@@ -942,7 +946,9 @@ EventAutoDevProbe(InputInfoPtr pInfo, const char *device)
libevdev_free(evdev);
}
- SYSCALL(close(fd));
+ if (!(pInfo->flags & XI86_SERVER_FD))
+ SYSCALL(close(fd));
+
/* if a device is set and not a touchpad (or already grabbed),
* we must return FALSE. Otherwise, we'll add a device that
* wasn't requested for and repeat