--- xf86-input-evdev-1.1.1/src/evdev_brain.c 2006-04-08 16:04:53.000000000 -0700 +++ xf86-input-evdev-1.1.1phil/src/evdev_brain.c 2006-04-30 14:02:05.000000000 -0700 @@ -39,6 +39,7 @@ #include #include +#include #include "inotify.h" #include "inotify-syscalls.h" @@ -348,6 +349,7 @@ { InputInfoPtr pInfo; int i; + int flags; pInfo = pPointer->public.devicePrivate; @@ -376,6 +378,19 @@ SYSCALL (close (pInfo->fd)); pInfo->fd = -1; } + if ((flags = fcntl(pInfo->fd, F_GETFL)) < 0) { + xf86Msg(X_ERROR, "%s: Unable to NONBLOCK inotify, using fallback. " + "(errno: %d)\n", pInfo->name, errno); + evdev_inotify = 0; + SYSCALL (close (pInfo->fd)); + pInfo->fd = -1; + } else if (fcntl(pInfo->fd, F_SETFL, flags | O_NONBLOCK) < 0) { + xf86Msg(X_ERROR, "%s: Unable to NONBLOCK inotify, using fallback. " + "(errno: %d)\n", pInfo->name, errno); + evdev_inotify = 0; + SYSCALL (close (pInfo->fd)); + pInfo->fd = -1; + } if (!evdev_inotify) { SYSCALL (pInfo->fd = open ("/proc/bus/usb/devices", O_RDONLY));