summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorJeremy Huddleston Sequoia <jeremyhu@apple.com>2016-09-19 01:13:02 -0700
committerPeter Hutterer <peter.hutterer@who-t.net>2016-09-21 21:11:40 +1000
commitd0c5d205a919fc1d2eb599356090b58b1bf0176d (patch)
treed0309c1a5ff43a0902971f9014f702188fd674b9 /dix
parent5794bdd52821463acf691c4230741f6b4289669b (diff)
dix: Make InitCoreDevices() failures more verbose.
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'dix')
-rw-r--r--dix/devices.c37
1 files changed, 26 insertions, 11 deletions
diff --git a/dix/devices.c b/dix/devices.c
index 56aae85e0..ea3c6c8a9 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -709,17 +709,32 @@ CorePointerProc(DeviceIntPtr pDev, int what)
void
InitCoreDevices(void)
{
- if (AllocDevicePair(serverClient, "Virtual core",
- &inputInfo.pointer, &inputInfo.keyboard,
- CorePointerProc, CoreKeyboardProc, TRUE) != Success)
- FatalError("Failed to allocate core devices");
-
- if (ActivateDevice(inputInfo.pointer, TRUE) != Success ||
- ActivateDevice(inputInfo.keyboard, TRUE) != Success)
- FatalError("Failed to activate core devices.");
- if (!EnableDevice(inputInfo.pointer, TRUE) ||
- !EnableDevice(inputInfo.keyboard, TRUE))
- FatalError("Failed to enable core devices.");
+ int result;
+
+ result = AllocDevicePair(serverClient, "Virtual core",
+ &inputInfo.pointer, &inputInfo.keyboard,
+ CorePointerProc, CoreKeyboardProc, TRUE);
+ if (result != Success) {
+ FatalError("Failed to allocate virtual core devices: %d", result);
+ }
+
+ result = ActivateDevice(inputInfo.pointer, TRUE);
+ if (result != Success) {
+ FatalError("Failed to activate virtual core pointer: %d", result);
+ }
+
+ result = ActivateDevice(inputInfo.keyboard, TRUE);
+ if (result != Success) {
+ FatalError("Failed to activate virtual core keyboard: %d", result);
+ }
+
+ if (!EnableDevice(inputInfo.pointer, TRUE)) {
+ FatalError("Failed to enable virtual core pointer.");
+ }
+
+ if (!EnableDevice(inputInfo.keyboard, TRUE)) {
+ FatalError("Failed to enable virtual core keyboard.");
+ }
InitXTestDevices();
}