[PATCH 1/1] dix: Make InitCoreDevices() failures more verbose.
Jeremy Huddleston Sequoia
jeremyhu at apple.com
Mon Sep 19 08:13:02 UTC 2016
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
---
dix/devices.c | 37 ++++++++++++++++++++++++++-----------
1 file changed, 26 insertions(+), 11 deletions(-)
diff --git a/dix/devices.c b/dix/devices.c
index 56aae85..ea3c6c8 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();
}
--
2.10.0 (Apple Git-77)
More information about the xorg-devel
mailing list