summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-07-19 12:42:43 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-07-19 12:42:43 +1000
commit6d660b0439973d2ee0c550e3413d75bd57763243 (patch)
treec05dd6fbb86093a43ced0d83d000269487f6b84d
parent02a74cfd0ba5ac0190307a63189ac643644b7574 (diff)
Test device in PreInit, fail if it cannot be opened.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/xf86HyperPen.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/xf86HyperPen.c b/src/xf86HyperPen.c
index 320add5..8b9011e 100644
--- a/src/xf86HyperPen.c
+++ b/src/xf86HyperPen.c
@@ -833,6 +833,14 @@ xf86HypInit(InputDriverPtr drv,
xf86Msg (X_ERROR, "%s: No Device specified.\n", pInfo->name);
rc = BadMatch;
goto SetupProc_fail;
+ } else {
+ pInfo->fd = xf86OpenSerial(pInfo->options);
+ if (pInfo->fd == -1) {
+ xf86Msg (X_ERROR, "%s: cannot open device '%s'\n", pInfo->name, priv->hypDevice);
+ return BadValue;
+ }
+ xf86CloseSerial(pInfo->fd);
+ pInfo->fd = -1;
}
pInfo->private = priv;