aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/packages/rpm/sle11/SOURCES/p_bug96328.diff
blob: 3fe9f46b50c1f4c298e39d2a47016387ac2f89c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Index: hw/xfree86/common/xf86Configure.c
================================================================================
--- hw/xfree86/common/xf86Configure.c
+++ hw/xfree86/common/xf86Configure.c
@@ -250,23 +250,35 @@
 
     /* Crude mechanism to auto-detect mouse (os dependent) */
     { 
-	int fd;
+	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;