xorg-x11-server/p_bug96328.diff

68 lines
1.7 KiB
Diff

Index: xf86Configure.c
===================================================================
RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/common/xf86Configure.c,v
retrieving revision 1.1.1.43.10.1
diff -u -r1.1.1.43.10.1 xf86Configure.c
--- programs/Xserver/hw/xfree86/common/xf86Configure.c 28 Jan 2005 16:21:08 -0000 1.1.1.43.10.1
+++ programs/Xserver/hw/xfree86/common/xf86Configure.c 3 Aug 2005 14:54:46 -0000
@@ -267,34 +267,36 @@
/* Crude mechanism to auto-detect mouse (os dependent) */
{
- int fd;
-#if 0 && defined linux
- /* Our autodetection code can do a better job */
- int len;
- char path[32];
-
- if ((len = readlink(DFLT_MOUSE_DEV, path, sizeof(path) - 1)) > 0) {
- path[len] = '\0';
- if (strstr(path, "psaux") != NULL)
- DFLT_MOUSE_PROTO = "PS/2";
- }
-#endif
+ int fd = -1;
+
#ifdef WSCONS_SUPPORT
- fd = open("/dev/wsmouse", 0);
- if (fd > 0) {
- DFLT_MOUSE_DEV = "/dev/wsmouse";
- DFLT_MOUSE_PROTO = "wsmouse";
- close(fd);
- } else {
- ErrorF("cannot open /dev/wsmouse\n");
+ 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");
+ }
}
#endif
#ifndef __SCO__
- fd = open(DFLT_MOUSE_DEV, 0);
- if (fd != -1) {
- foundMouse = TRUE;
- close(fd);
+ if (fd == -1) {
+ fd = open(DFLT_MOUSE_DEV, 0);
+# ifdef linux
+ if (fd == -1) {
+ char *name = "/dev/input/mice";
+ fd = open(name, 0);
+ if (fd != -1)
+ DFLT_MOUSE_DEV = name;
+ }
+# endif
+ if (fd != -1) {
+ foundMouse = TRUE;
+ close(fd);
+ }
}
#else
foundMouse = TRUE;