[PATCH xf86-input-evdev] Print cause of a failed open(..) call

Peter Hutterer peter.hutterer at who-t.net
Tue Jan 30 03:39:00 UTC 2018


On Wed, Jan 24, 2018 at 01:19:10PM +0100, Christian Gmeiner wrote:
> This is quite helpful for debugging.
> 
> Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
> ---
>  src/evdev.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/evdev.c b/src/evdev.c
> index cffed7f..84d50c8 100644
> --- a/src/evdev.c
> +++ b/src/evdev.c
> @@ -2453,7 +2453,7 @@ EvdevOpenMTDev(InputInfoPtr pInfo)
>      if (pEvdev->mtdev)
>          pEvdev->cur_slot = pEvdev->mtdev->caps.slot.value;
>      else {
> -        xf86Msg(X_ERROR, "%s: Couldn't open mtdev device\n", pInfo->name);
> +        xf86Msg(X_ERROR, "%s: Couldn't open mtdev device (%s)\n", pInfo->name, strerror(errno));

this one won't work. I just had a look at the mtdev sources and it doesn't
preserve the errno. So the best you can do on a failed mtdev_new_open() is
shrug and move on. I've removed this hunk from the patch and pushed the rest
as 192fdb0..ab1d9ad  master -> master

Thanks

Cheers,
   Peter


>          EvdevCloseDevice(pInfo);
>          return FALSE;
>      }
> @@ -2487,7 +2487,7 @@ EvdevOpenDevice(InputInfoPtr pInfo)
>      }
>  
>      if (pInfo->fd < 0) {
> -        xf86IDrvMsg(pInfo, X_ERROR, "Unable to open evdev device \"%s\".\n", device);
> +        xf86IDrvMsg(pInfo, X_ERROR, "Unable to open evdev device \"%s\" (%s).\n", device, strerror(errno));
>          return BadValue;
>      }
>  
> -- 
> 2.14.3
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: https://lists.x.org/mailman/listinfo/xorg-devel
> 


More information about the xorg-devel mailing list