summaryrefslogtreecommitdiff
path: root/x11/xf86-input-mouse/patches/patch-src_bsd_mouse_c
blob: 2c2155e80a30060932e5c1df504cdaeba25d4267 (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

Index: src/bsd_mouse.c
--- src/bsd_mouse.c.orig
+++ src/bsd_mouse.c
@@ -70,6 +70,10 @@ static void usbSigioReadInput (int fd, void *closure);
 #endif
 static const char *FindDevice(InputInfoPtr, const char *, int);
 
+#ifdef X_PRIVSEP
+extern int priv_open_device(const char *);
+#endif
+
 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
 /* These are for FreeBSD and DragonFly */
 #define DEFAULT_MOUSE_DEV               "/dev/mouse"
@@ -281,7 +285,11 @@ FindDevice(InputInfoPtr pInfo, const char *protocol, i
     struct stat sb;
 
     for (pdev = mouseDevs; *pdev; pdev++) {
+#ifndef X_PRIVSEP
         SYSCALL (fd = open(*pdev, O_RDWR | O_NONBLOCK));
+#else
+        fd = priv_open_device(*pdev);
+#endif
         if (fd == -1) {
 #ifdef DEBUG
             ErrorF("Cannot open %s (%s)\n", *pdev, strerror(errno));
@@ -364,7 +372,11 @@ FindDevice(InputInfoPtr pInfo, const char *protocol, i
     const char **pdev;
 
     for (pdev = mouseDevs; *pdev; pdev++) {
+#ifndef X_PRIVSEP
         SYSCALL(fd = open(*pdev, O_RDWR | O_NONBLOCK));
+#else
+        fd = priv_open_device(*pdev);
+#endif
         if (fd != -1) {
             /* Set the Device option. */
             pInfo->options =
@@ -449,6 +461,11 @@ wsconsReadInput(InputInfoPtr pInfo)
 #endif
 #ifdef WSCONS_EVENT_MOUSE_ABSOLUTE_W
 	case WSCONS_EVENT_MOUSE_ABSOLUTE_W:
+	    ++event;
+	    continue;
+#endif
+#ifdef WSCONS_EVENT_SYNC
+	case WSCONS_EVENT_SYNC:
 	    ++event;
 	    continue;
 #endif