From 6d660b0439973d2ee0c550e3413d75bd57763243 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 19 Jul 2011 12:42:43 +1000 Subject: Test device in PreInit, fail if it cannot be opened. Signed-off-by: Peter Hutterer diff --git a/src/xf86HyperPen.c b/src/xf86HyperPen.c index 320add5..8b9011e 100644 --- src/xf86HyperPen.c +++ 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; -- cgit v0.10.2