diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-07-19 11:44:35 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-07-19 11:51:09 +1000 |
commit | dc40c58c70b785c102a27652569c3de30fc44a9b (patch) | |
tree | 7519f83dab538cc9409750f8e22c75a33460f916 | |
parent | 4b47b4a9cdce3bd0368aacb8164aa02e05670a88 (diff) |
Test opening the device in PreInit, fail if necessary
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/xf86Fpit.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/xf86Fpit.c b/src/xf86Fpit.c index 2da34aa..8c9c830 100644 --- a/src/xf86Fpit.c +++ b/src/xf86Fpit.c @@ -568,6 +568,14 @@ static int xf86FpitInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) if (!str) { xf86Msg(X_ERROR, "%s: No Device specified in FPIT module config.\n", pInfo->name); return BadValue; + } else { + pInfo->fd = xf86OpenSerial(pInfo->options); + if (pInfo->fd < 0) { + xf86Msg(X_ERROR, "%s: Unable to open Fpit touchscreen device '%s'", pInfo->name, str); + return BadValue; + } + xf86CloseSerial(pInfo->fd); + pInfo->fd = -1; } priv->fpitDev = strdup(str); priv->screen_no = xf86SetIntOption(pInfo->options, "ScreenNo", 0); |