summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2010-07-22 11:32:08 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2010-07-22 13:26:40 +1000
commit4964c61f4b248e9eb16e8eadb5f5d0b6410b6b84 (patch)
tree2782148e36eaf7f3379736bd62b67bb205ff66e3
parent92e8dc49611398c8a9659b244645530cd26736fe (diff)
Return BadMatch for already configured devices.
PreInit can now return different error codes. Return BadAlloc for alloc failures and BadMatch if the device was already configured or the cache comparison/probe failed. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/evdev.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/evdev.c b/src/evdev.c
index 882ca7b..851ae8d 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -2079,6 +2079,7 @@ EvdevPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
#endif
{
EvdevPtr pEvdev;
+ int rc = BadAlloc;
if (!(pEvdev = calloc(sizeof(EvdevRec), 1)))
goto error;
@@ -2110,6 +2111,7 @@ EvdevPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
{
xf86Msg(X_WARNING, "%s: Device may already be configured.\n",
pInfo->name);
+ rc = BadMatch;
goto error;
}
@@ -2117,6 +2119,7 @@ EvdevPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
if (EvdevCacheCompare(pInfo, FALSE) ||
EvdevProbe(pInfo)) {
+ rc = BadMatch;
goto error;
}
@@ -2134,7 +2137,7 @@ EvdevPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
error:
if (pInfo->fd >= 0)
close(pInfo->fd);
- return BadAlloc;
+ return rc;
}
_X_EXPORT InputDriverRec EVDEV = {