diff options
Diffstat (limited to 'hw/xfree86/os-support/hurd/hurd_mouse.c')
-rw-r--r-- | hw/xfree86/os-support/hurd/hurd_mouse.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/hw/xfree86/os-support/hurd/hurd_mouse.c b/hw/xfree86/os-support/hurd/hurd_mouse.c index ccc08a248..089cba38d 100644 --- a/hw/xfree86/os-support/hurd/hurd_mouse.c +++ b/hw/xfree86/os-support/hurd/hurd_mouse.c @@ -20,7 +20,6 @@ * PERFORMANCE OF THIS SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/hurd/hurd_mouse.c,v 1.7 2000/02/10 22:33:44 dawes Exp $ */ #define NEED_EVENTS #ifdef HAVE_XORG_CONFIG_H @@ -47,6 +46,8 @@ #include <mach.h> #include <sys/ioctl.h> +#define DEFAULT_MOUSE_DEV "/dev/mouse" + typedef unsigned short kev_type; /* kd event type */ typedef unsigned char Scancode; @@ -167,6 +168,26 @@ OsMousePreInit(InputInfoPtr pInfo, const char *protocol, int flags) return TRUE; } +static const char * +FindDevice(InputInfoPtr pInfo, const char *protocol, int flags) +{ + const char path[] = DEFAULT_MOUSE_DEV; + int fd; + + SYSCALL (fd = open(path, O_RDWR | O_NONBLOCK | O_EXCL)); + + if (fd == -1) + return NULL; + + close(fd); + pInfo->conf_idev->commonOptions = + xf86AddNewOption(pInfo->conf_idev->commonOptions, "Device", path); + xf86Msg(X_INFO, "%s: Setting Device option to \"%s\"\n", pInfo->name, + path); + + return path; +} + static int SupportedInterfaces(void) { @@ -196,7 +217,6 @@ CheckProtocol(const char *protocol) return FALSE; } -/* XXX Is this appropriate? If not, this function should be removed. */ static const char * DefaultProtocol(void) { @@ -213,6 +233,7 @@ xf86OSMouseInit(int flags) return NULL; p->SupportedInterfaces = SupportedInterfaces; p->BuiltinNames = BuiltinNames; + p->FindDevice = FindDevice; p->DefaultProtocol = DefaultProtocol; p->CheckProtocol = CheckProtocol; p->PreInit = OsMousePreInit; |