From f51d8cc79b5f7d3c9c5d9c5838398af8c81c1f2c Mon Sep 17 00:00:00 2001 From: Peter Osterlund Date: Sat, 19 Feb 2005 10:55:41 +0100 Subject: Made the event auto device detection work even if some /dev/input/event nodes are missing, which can happen when using a udev based system. --- eventcomm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'eventcomm.c') diff --git a/eventcomm.c b/eventcomm.c index ea48a72..36e4cd1 100644 --- a/eventcomm.c +++ b/eventcomm.c @@ -235,6 +235,7 @@ EventAutoDevProbe(LocalDevicePtr local) the psaux protocol and the given device from XF86Config */ int i; Bool have_evdev = FALSE; + int noent_cnt = 0; for (i = 0; ; i++) { char fname[64]; @@ -245,11 +246,15 @@ EventAutoDevProbe(LocalDevicePtr local) SYSCALL(fd = open(fname, O_RDONLY)); if (fd < 0) { if (errno == ENOENT) { - break; + if (++noent_cnt >= 10) + break; + else + continue; } else { continue; } } + noent_cnt = 0; have_evdev = TRUE; is_touchpad = event_query_is_touchpad(fd); SYSCALL(close(fd)); -- cgit v1.2.3