[PATCH xserver] Simplify auto-detect mouse for WSCONS_SUPPORT

Matthieu Herrb matthieu.herrb at laas.fr
Sun Apr 10 02:49:47 PDT 2011


On Sat, Apr 09, 2011 at 05:45:10PM +0600, Alexandr Shadchin wrote:
> Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin at gmail.com>

Reviewed-by: Matthieu Herrbb <matthieu.herrb at laas.fr>

> ---
>  hw/xfree86/common/xf86Configure.c |   13 +++----------
>  1 files changed, 3 insertions(+), 10 deletions(-)
> 
> diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
> index c712df7..9752669 100644
> --- a/hw/xfree86/common/xf86Configure.c
> +++ b/hw/xfree86/common/xf86Configure.c
> @@ -63,6 +63,9 @@ static char *DFLT_MOUSE_PROTO = "auto";
>  #elif defined(linux)
>  static char DFLT_MOUSE_DEV[] = "/dev/input/mice";
>  static char DFLT_MOUSE_PROTO[] = "auto";
> +#elif defined(WSCONS_SUPPORT)
> +static char *DFLT_MOUSE_DEV = "/dev/wsmouse";
> +static char *DFLT_MOUSE_PROTO = "wsmouse";
>  #else
>  static char *DFLT_MOUSE_DEV = "/dev/mouse";
>  static char *DFLT_MOUSE_PROTO = "auto";
> @@ -154,16 +157,6 @@ configureInputSection (void)
>      /* Crude mechanism to auto-detect mouse (os dependent) */
>      { 
>  	int fd;
> -#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");
> -	}
> -#endif
>  
>  	fd = open(DFLT_MOUSE_DEV, 0);
>  	if (fd != -1) {
> -- 
> 1.7.3.5
> 

-- 
Matthieu Herrb


More information about the xorg-devel mailing list