2009-08-04 21:52:16 +02:00
|
|
|
Index: hw/xfree86/common/xf86Configure.c
|
2010-03-20 03:42:15 +01:00
|
|
|
================================================================================
|
|
|
|
--- hw/xfree86/common/xf86Configure.c
|
2009-08-04 21:52:16 +02:00
|
|
|
+++ hw/xfree86/common/xf86Configure.c
|
2010-03-20 03:42:15 +01:00
|
|
|
@@ -250,23 +250,35 @@
|
2006-12-18 15:48:26 +01:00
|
|
|
|
|
|
|
/* Crude mechanism to auto-detect mouse (os dependent) */
|
|
|
|
{
|
|
|
|
- int fd;
|
|
|
|
+ int fd = -1;
|
|
|
|
#ifdef WSCONS_SUPPORT
|
|
|
|
- fd = open("/dev/wsmouse", 0);
|
2010-03-20 03:42:15 +01:00
|
|
|
- if (fd >= 0) {
|
2006-12-18 15:48:26 +01:00
|
|
|
- DFLT_MOUSE_DEV = "/dev/wsmouse";
|
|
|
|
- DFLT_MOUSE_PROTO = "wsmouse";
|
|
|
|
- close(fd);
|
|
|
|
- } else {
|
|
|
|
- ErrorF("cannot open /dev/wsmouse\n");
|
2010-03-20 03:42:15 +01:00
|
|
|
+ if (fd == -1) {
|
|
|
|
+ fd = open("/dev/wsmouse", 0);
|
|
|
|
+ if (fd != -1) {
|
|
|
|
+ DFLT_MOUSE_DEV = "/dev/wsmouse";
|
|
|
|
+ DFLT_MOUSE_PROTO = "wsmouse";
|
|
|
|
+ close(fd);
|
|
|
|
+ } else {
|
|
|
|
+ ErrorF("cannot open /dev/wsmouse\n");
|
|
|
|
+ }
|
2006-12-18 15:48:26 +01:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __SCO__
|
|
|
|
- fd = open(DFLT_MOUSE_DEV, 0);
|
|
|
|
- if (fd != -1) {
|
|
|
|
- foundMouse = TRUE;
|
|
|
|
- close(fd);
|
2010-03-20 03:42:15 +01:00
|
|
|
+ if (fd == -1) {
|
|
|
|
+ fd = open(DFLT_MOUSE_DEV, 0);
|
2006-12-18 15:48:26 +01:00
|
|
|
+# ifdef linux
|
2010-03-20 03:42:15 +01:00
|
|
|
+ if (fd == -1) {
|
|
|
|
+ char *name = "/dev/input/mice";
|
|
|
|
+ fd = open(name, 0);
|
|
|
|
+ if (fd != -1)
|
|
|
|
+ DFLT_MOUSE_DEV = name;
|
|
|
|
+ }
|
2006-12-18 15:48:26 +01:00
|
|
|
+# endif
|
2010-03-20 03:42:15 +01:00
|
|
|
+ if (fd != -1) {
|
|
|
|
+ foundMouse = TRUE;
|
|
|
|
+ close(fd);
|
|
|
|
+ }
|
2006-12-18 15:48:26 +01:00
|
|
|
}
|
|
|
|
#else
|
|
|
|
foundMouse = TRUE;
|