aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/common/xf86Init.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-08-01 09:13:47 +0200
committermarha <marha@users.sourceforge.net>2011-08-01 09:13:47 +0200
commit6730a76afc49a80573b2e582085086c2956fe96d (patch)
tree1478eb4f497670caeb2af983eadc4aee20f48b68 /xorg-server/hw/xfree86/common/xf86Init.c
parenta69cff9373daf6b7afc97fb975ceb4fc0d6864f7 (diff)
parentf87ad0cdc41af88f134475ab50b0d604004d9cdc (diff)
downloadvcxsrv-6730a76afc49a80573b2e582085086c2956fe96d.tar.gz
vcxsrv-6730a76afc49a80573b2e582085086c2956fe96d.tar.bz2
vcxsrv-6730a76afc49a80573b2e582085086c2956fe96d.zip
Merge remote-tracking branch 'origin/released'
Conflicts: mesalib/src/glsl/ast_function.cpp mesalib/src/glsl/glsl_types.cpp mesalib/src/mesa/main/teximage.c mesalib/src/mesa/main/texparam.c xorg-server/config/udev.c xorg-server/configure.ac xorg-server/dix/main.c xorg-server/hw/dmx/dmxinit.c xorg-server/hw/kdrive/src/kdrive.c xorg-server/hw/xfree86/common/xf86Config.c xorg-server/hw/xfree86/common/xf86Configure.c xorg-server/hw/xfree86/common/xf86Helper.c xorg-server/hw/xfree86/common/xf86Init.c xorg-server/hw/xfree86/common/xf86Option.c xorg-server/hw/xfree86/common/xf86Priv.h xorg-server/hw/xfree86/common/xf86Xinput.c xorg-server/hw/xnest/Init.c xorg-server/hw/xquartz/darwin.c xorg-server/hw/xwin/InitOutput.c xorg-server/hw/xwin/winerror.c xorg-server/hw/xwin/xlaunch/config.cc xorg-server/hw/xwin/xlaunch/config.h xorg-server/hw/xwin/xlaunch/main.cc xorg-server/hw/xwin/xlaunch/resources/dialog.rc xorg-server/hw/xwin/xlaunch/resources/resources.h xorg-server/hw/xwin/xlaunch/resources/resources.rc xorg-server/hw/xwin/xlaunch/resources/strings.rc xorg-server/hw/xwin/xlaunch/window/util.cc xorg-server/hw/xwin/xlaunch/window/util.h xorg-server/hw/xwin/xlaunch/window/wizard.h xorg-server/include/os.h xorg-server/os/log.c xorg-server/xkeyboard-config/symbols/lv
Diffstat (limited to 'xorg-server/hw/xfree86/common/xf86Init.c')
-rw-r--r--xorg-server/hw/xfree86/common/xf86Init.c40
1 files changed, 31 insertions, 9 deletions
diff --git a/xorg-server/hw/xfree86/common/xf86Init.c b/xorg-server/hw/xfree86/common/xf86Init.c
index 44071996c..94e1a5dbd 100644
--- a/xorg-server/hw/xfree86/common/xf86Init.c
+++ b/xorg-server/hw/xfree86/common/xf86Init.c
@@ -791,6 +791,21 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
NULL);
}
+static InputInfoPtr
+duplicateDevice(InputInfoPtr pInfo)
+{
+ InputInfoPtr dup = calloc(1, sizeof(InputInfoRec));
+ if (dup) {
+ dup->name = strdup(pInfo->name);
+ dup->driver = strdup(pInfo->driver);
+ dup->options = xf86OptionListDuplicate(pInfo->options);
+ /* type_name is a const string */
+ dup->type_name = pInfo->type_name;
+ dup->fd = -1;
+ }
+ return dup;
+}
+
/*
* InitInput --
* Initialize all supported input devices.
@@ -799,7 +814,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
void
InitInput(int argc, char **argv)
{
- InputInfoPtr* pDev;
+ InputInfoPtr* pInfo;
DeviceIntPtr dev;
xf86Info.vtRequestsPending = FALSE;
@@ -807,14 +822,21 @@ InitInput(int argc, char **argv)
mieqInit();
/* Initialize all configured input devices */
- for (pDev = xf86ConfigLayout.inputs; pDev && *pDev; pDev++) {
+ for (pInfo = xf86ConfigLayout.inputs; pInfo && *pInfo; pInfo++) {
+ InputInfoPtr dup;
/* Replace obsolete keyboard driver with kbd */
- if (!xf86NameCmp((*pDev)->driver, "keyboard")) {
- strcpy((*pDev)->driver, "kbd");
+ if (!xf86NameCmp((*pInfo)->driver, "keyboard")) {
+ strcpy((*pInfo)->driver, "kbd");
}
+ /* Data passed into xf86NewInputDevice will be freed on shutdown.
+ * Duplicate from xf86ConfigLayout.inputs, otherwise we don't have any
+ * xorg.conf input devices in the second generation
+ */
+ dup = duplicateDevice(*pInfo);
+
/* If one fails, the others will too */
- if (xf86NewInputDevice(*pDev, &dev, TRUE) == BadAlloc)
+ if (xf86NewInputDevice(dup, &dev, TRUE) == BadAlloc)
break;
}
@@ -880,7 +902,7 @@ OsVendorInit(void)
*/
void
-ddxGiveUp(void)
+ddxGiveUp(enum ExitCode error)
{
int i;
@@ -907,7 +929,7 @@ ddxGiveUp(void)
if (xorgHWOpenConsole)
xf86CloseConsole();
- xf86CloseLog();
+ xf86CloseLog(error);
/* If an unexpected signal was caught, dump a core for debugging */
if (xf86Info.caughtSignal)
@@ -924,7 +946,7 @@ ddxGiveUp(void)
*/
void
-AbortDDX(void)
+AbortDDX(enum ExitCode error)
{
int i;
@@ -957,7 +979,7 @@ AbortDDX(void)
* This is needed for an abnormal server exit, since the normal exit stuff
* MUST also be performed (i.e. the vt must be left in a defined state)
*/
- ddxGiveUp();
+ ddxGiveUp(error);
}
void