open-src/xserver/xorg/sun-virtual-mouse.patch
changeset 606 068c11b419c9
parent 605 e5259db5befc
child 607 261c0d718d67
equal deleted inserted replaced
605:e5259db5befc 606:068c11b419c9
     1 --- hw/xfree86/os-support/solaris/sun_mouse.c	2006-10-11 13:46:15.000000000 -0700
       
     2 +++ hw/xfree86/os-support/sunos/sun_mouse.c	2006-01-25 17:42:37.627729000 -0800
       
     3 @@ -601,44 +603,9 @@
       
     4  solarisMouseAutoProbe(InputInfoPtr pInfo, const char **protocol, 
       
     5  	const char **device)
       
     6  {
       
     7 -    const char **pdev, **pproto, *dev = NULL;
       
     8 -    int fd = -1;
       
     9 -    Bool found;
       
    10 -
       
    11 -    for (pdev = solarisMouseDevs; *pdev; pdev += 2) {
       
    12 -	pproto = pdev + 1;
       
    13 -	if ((*protocol != NULL) && (strcmp(*protocol, "Auto") != 0) &&
       
    14 -	  (*pproto != NULL) && (strcmp(*pproto, *protocol) != 0)) {
       
    15 -	    continue;
       
    16 -	}
       
    17 -	if ((*device != NULL) && (strcmp(*device, *pdev) != 0)) {
       
    18 -	    continue;
       
    19 -	}
       
    20 -        SYSCALL (fd = open(*pdev, O_RDWR | O_NONBLOCK));
       
    21 -	if (fd == -1) {
       
    22 -#ifdef DEBUG
       
    23 -	    ErrorF("Cannot open %s (%s)\n", pdev, strerror(errno));
       
    24 -#endif
       
    25 -	} else {
       
    26 -	    found = TRUE;
       
    27 -	    if ((*pproto != NULL) && (strcmp(*pproto, "VUID") == 0)) {
       
    28 -		int i, r;
       
    29 -		SYSCALL(r = ioctl(fd, VUIDGFORMAT, &i));
       
    30 -    		if (r < 0) {
       
    31 -		    found = FALSE;
       
    32 -		}
       
    33 -	    }
       
    34 -	    close(fd);
       
    35 -	    if (found == TRUE) {
       
    36 -		if (*pproto != NULL) {
       
    37 -		    *protocol = *pproto;
       
    38 -		}
       
    39 -		*device = *pdev;
       
    40 -		return TRUE;
       
    41 -	    }
       
    42 -	}
       
    43 -    }
       
    44 -    return FALSE;
       
    45 +    *protocol = "VUID";
       
    46 +    *device = "/dev/mouse";
       
    47 +    return TRUE;
       
    48  }
       
    49  
       
    50  static const char *