summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-07-19 12:59:31 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-07-20 10:47:41 +1000
commit7bd05fe5ed04be7abcccac2ce42d939f585ed41d (patch)
tree9da516d369815236d83b011923b04cd76949bf39
parentea858f9e49c06b2728dc91c62616533a01ff484c (diff)
Test-open device in PreInit, fail if it doesn't work.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/xf86MuTouch.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/xf86MuTouch.c b/src/xf86MuTouch.c
index 1d56efd..fd0b930 100644
--- a/src/xf86MuTouch.c
+++ b/src/xf86MuTouch.c
@@ -1097,6 +1097,15 @@ xf86MuTInit(InputDriverPtr drv,
pInfo->name);
rc = BadValue;
goto init_err;
+ } else {
+ pInfo->fd = xf86OpenSerial(pInfo->options);
+ if (pInfo->fd < 0) {
+ xf86Msg(X_ERROR, "%s: Unable to open MuTouch touchscreen device '%s'\n", pInfo->name, str);
+ rc = BadValue;
+ goto init_err;
+ }
+ close(pInfo->fd);
+ pInfo->fd = -1;
}
priv->input_dev = strdup(str);