[PATCH] XInput: protocol error handling cleanup

Peter Hutterer mailinglists at who-t.net
Wed Sep 26 16:42:52 PDT 2007


Eamon Walsh wrote:
> Error handling cleanup patch for XInput.  Return errors to the dispatcher
> instead of calling SendErrorToClient.  Also fixes 2 "unused variable: stuff"
> warnings.
> 
> Will commit to master, without objection.

looks fine to me. no testing done though.


> @@ -98,10 +95,8 @@ SProcXChangeKeyboardDevice(ClientPtr client)
>  int
>  ProcXChangeKeyboardDevice(ClientPtr client)
>  {
> -    REQUEST(xChangeKeyboardDeviceReq);
> +    /* REQUEST(xChangeKeyboardDeviceReq); */
>      REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq);
>  
> -    SendErrorToClient(client, IReqCode, X_ChangeKeyboardDevice, 0,
> -                      BadDevice);
> -    return Success;
> +    return BadDevice;
>  }

just remove the REQUEST line completely. If it doesn't spit out an error
and it isn't used anyway I think this is more obvious than having it as
a comment (which looks more like a debugging thing).

> @@ -101,10 +98,8 @@ SProcXChangePointerDevice(ClientPtr client)
>  int
>  ProcXChangePointerDevice(ClientPtr client)
>  {
> -    REQUEST(xChangePointerDeviceReq);
> +    /* REQUEST(xChangePointerDeviceReq); */
>      REQUEST_SIZE_MATCH(xChangePointerDeviceReq);
>  
> -    SendErrorToClient(client, IReqCode, X_ChangePointerDevice, 0,
> -                      BadDevice);
> -    return Success;
> +    return BadDevice;
>  }

same as above.

Cheers,
    Peter




More information about the xorg mailing list