From d0c5d205a919fc1d2eb599356090b58b1bf0176d Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Sequoia Date: Mon, 19 Sep 2016 01:13:02 -0700 Subject: dix: Make InitCoreDevices() failures more verbose. Signed-off-by: Jeremy Huddleston Sequoia Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- dix/devices.c | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) (limited to 'dix') 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(); } -- cgit v1.2.3