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

Christian Gmeiner christian.gmeiner at gmail.com
Wed Jan 24 12:19:10 UTC 2018


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));
         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



More information about the xorg-devel mailing list