From f315ae066598d0dc955db081f8d0faf8d358292d Mon Sep 17 00:00:00 2001
From: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Date: Fri, 24 Feb 2017 13:03:30 +0000
Subject: os: Initialize NotifyFds earlier in startup

 Backported from X.org:

 commit ce6546337487c052b5dd3c04d3d8d4b09d691c3d
 Author: Keith Packard <keithp@keithp.com>
 Date:   Tue May 31 09:38:17 2016 -0700

    os: Initialize NotifyFds earlier in startup

    If the server calls AbortServer during the first-time initialization
    (which can happen if you start the server on an already using
    DISPLAY), then the dbus code will shut down and call the notify fd
    interface. If the notify fd list hasn't been initialized, the server
    will crash.

    Signed-off-by: Keith Packard <keithp@keithp.com>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>

 Backported-to-NX-by: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
---
 nx-X11/programs/Xserver/os/osinit.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'nx-X11/programs')

diff --git a/nx-X11/programs/Xserver/os/osinit.c b/nx-X11/programs/Xserver/os/osinit.c
index e1986a577..08fbb8c89 100644
--- a/nx-X11/programs/Xserver/os/osinit.c
+++ b/nx-X11/programs/Xserver/os/osinit.c
@@ -101,10 +101,15 @@ OsInit(void)
 #endif
 
     if (!been_here) {
+
+	InitNotifyFds();
+
 #if !defined(__SCO__) && !defined(__CYGWIN__) && !defined(__UNIXWARE__)
 	fclose(stdin);
 	fclose(stdout);
 #endif
+
+
 	/* 
 	 * If a write of zero bytes to stderr returns non-zero, i.e. -1, 
 	 * then writing to stderr failed, and we'll write somewhere else 
@@ -203,7 +208,6 @@ OsInit(void)
 #endif
 	been_here = TRUE;
     }
-    InitNotifyFds();
     TimerInit();
 #ifdef DDXOSINIT
     OsVendorInit();
-- 
cgit v1.2.3