diff options
author | Alan Hourihane <alanh@fairlite.demon.co.uk> | 2006-11-18 19:55:42 +0000 |
---|---|---|
committer | Alan Hourihane <alanh@fairlite.demon.co.uk> | 2006-11-18 19:55:42 +0000 |
commit | c9a5f9d3911c2e6a8f81b0721c9eb914fb7719b5 (patch) | |
tree | ef2a4502f847794b6d326e2dafb11c752ff28c02 | |
parent | acb5ff4c73ac4d52201d7c421f488e2ead5c8b9c (diff) |
Shutdown input devices if FatalError occurs during startup.
Fixes Xdmx problems when the input device has been initialized
and the keyboard map has been destroyed.
-rw-r--r-- | dix/main.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/dix/main.c b/dix/main.c index 88d775571..bee5490fd 100644 --- a/dix/main.c +++ b/dix/main.c @@ -414,21 +414,27 @@ main(int argc, char *argv[], char *envp[]) ErrorF("failed to set default font path '%s'", defaultFontPath); } - if (!SetDefaultFont(defaultTextFont)) + if (!SetDefaultFont(defaultTextFont)) { + CloseDownDevices(); FatalError("could not open default font '%s'", defaultTextFont); + } #ifdef NULL_ROOT_CURSOR cm.width = 0; cm.height = 0; cm.xhot = 0; cm.yhot = 0; - if (!(rootCursor = AllocCursor(NULL, NULL, &cm, 0, 0, 0, 0, 0, 0))) + if (!(rootCursor = AllocCursor(NULL, NULL, &cm, 0, 0, 0, 0, 0, 0))) { + CloseDownDevices(); FatalError("could not create empty root cursor"); + } AddResource(FakeClientID(0), RT_CURSOR, (pointer)rootCursor); #else - if (!(rootCursor = CreateRootCursor(defaultCursorFont, 0))) + if (!(rootCursor = CreateRootCursor(defaultCursorFont, 0))) { + CloseDownDevices(); FatalError("could not open default cursor font '%s'", defaultCursorFont); + } #endif #ifdef DPMSExtension /* check all screens, looking for DPMS Capabilities */ @@ -452,13 +458,17 @@ main(int argc, char *argv[], char *envp[]) #ifdef PANORAMIX if (!noPanoramiXExtension) { - if (!PanoramiXCreateConnectionBlock()) + if (!PanoramiXCreateConnectionBlock()) { + CloseDownDevices(); FatalError("could not create connection block info"); + } } else #endif { - if (!CreateConnectionBlock()) + if (!CreateConnectionBlock()) { + CloseDownDevices(); FatalError("could not create connection block info"); + } } Dispatch(); |