Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > e1f00bb81ce1de0e60f99fa060b924c1 > files > 2

x11-driver-input-mouse-1.2.2-2mdv2008.0.src.rpm

--- xf86-input-mouse-1.1.1/src/mouse.c.mouse-twice	2006-05-26 09:55:39.000000000 -0400
+++ xf86-input-mouse-1.1.1/src/mouse.c	2006-06-02 15:10:02.000000000 -0400
@@ -1111,7 +1111,17 @@
     /* OS/2 has a mouse handled by the OS - it cannot fail here */
 
     /* Check if the device can be opened. */
-    pInfo->fd = xf86OpenSerial(pInfo->options);
+    if (pInfo->fd == -1) {
+      pInfo->fd = xf86OpenSerial(pInfo->options);
+    }
+    
+    /* FL [Wed Nov 27 04:07:13 EST 2002]
+     * Try a second time if it fails to workaround a kernel
+     * bug that make the mouse device disappear */
+    if (pInfo->fd == -1) {
+      pInfo->fd = xf86OpenSerial(pInfo->options);
+    }
+    
     if (pInfo->fd == -1) {
 	if (xf86GetAllowMouseOpenFail())
 	    xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
@@ -1124,9 +1134,9 @@
 	    return pInfo;
 	}
     }
-    xf86CloseSerial(pInfo->fd);
+    /* xf86CloseSerial(pInfo->fd); */
 #endif
-    pInfo->fd = -1;
+    /* pInfo->fd = -1; */
 
     if (!(mPriv = (pointer) xcalloc(sizeof(mousePrivRec), 1)))
 	return pInfo;
@@ -1726,7 +1736,10 @@
 	break;
 
     case DEVICE_ON:
-	pInfo->fd = xf86OpenSerial(pInfo->options);
+	if (pInfo->fd == -1)
+	    pInfo->fd = xf86OpenSerial(pInfo->options);
+	if (pInfo->fd == -1)
+	    pInfo->fd = xf86OpenSerial(pInfo->options);
 	if (pInfo->fd == -1)
 	    xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
 	else {