[Xquartz-changes] xserver: Branch 'for-keith' - 2 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Mon Oct 10 13:53:10 PDT 2011


 hw/kdrive/ephyr/hostx.c |    9 +++++++++
 hw/xnest/Display.c      |   11 ++++++++++-
 hw/xnest/Events.c       |    2 ++
 3 files changed, 21 insertions(+), 1 deletion(-)

New commits:
commit 7ef7c145b812275f9d0d0d95c94a52a0b83bc64b
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Mon Oct 10 12:16:31 2011 -0700

    Xephyr: Remove socket and its lock file on exit
    
    https://bugs.freedesktop.org/show_bug.cgi?id=11484
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    Reviewed-by: Mikhail Gusarov <dottedmag at dottedmag.net>

diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index 4caf451..9ed45e3 100644
--- a/hw/kdrive/ephyr/hostx.c
+++ b/hw/kdrive/ephyr/hostx.c
@@ -331,6 +331,13 @@ hostx_set_title (char *title)
   ephyrTitle = title;
 }
 
+static int _X_NORETURN
+x_io_error_handler (Display *dpy) {
+    CloseWellKnownConnections();
+    OsCleanup(1);
+    exit(0);
+}
+
 int
 hostx_init (void)
 {
@@ -358,6 +365,8 @@ hostx_init (void)
       exit(1);
     }
 
+  XSetIOErrorHandler(x_io_error_handler);
+
   HostX.screen  = DefaultScreen(HostX.dpy);
   HostX.winroot = RootWindow(HostX.dpy, HostX.screen);
   HostX.gc      = XCreateGC(HostX.dpy, HostX.winroot, 0, NULL);
commit 65b7a896d8694402d2077e4c47702ea812dd6d1f
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Mon Oct 10 12:09:39 2011 -0700

    Xnest: Remove socket and its lock file on exit
    
    https://bugs.freedesktop.org/show_bug.cgi?id=11484
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    Reviewed-by: Mikhail Gusarov <dottedmag at dottedmag.net>

diff --git a/hw/xnest/Display.c b/hw/xnest/Display.c
index b78aff5..e7bf249 100644
--- a/hw/xnest/Display.c
+++ b/hw/xnest/Display.c
@@ -52,6 +52,13 @@ Pixmap xnestScreenSaverPixmap;
 XlibGC xnestBitmapGC;
 unsigned long xnestEventMask;
 
+static int _X_NORETURN
+x_io_error_handler (Display *dpy) {
+    CloseWellKnownConnections();
+    OsCleanup(1);
+    exit(0);
+}
+
 void
 xnestOpenDisplay(int argc, char *argv[])
 {
@@ -60,7 +67,9 @@ xnestOpenDisplay(int argc, char *argv[])
   int i, j;
 
   if (!xnestDoFullGeneration) return;
-  
+
+  XSetIOErrorHandler(x_io_error_handler);
+
   xnestCloseDisplay();
 
   xnestDisplay = XOpenDisplay(xnestDisplayName);
diff --git a/hw/xnest/Events.c b/hw/xnest/Events.c
index 619427d..2399313 100644
--- a/hw/xnest/Events.c
+++ b/hw/xnest/Events.c
@@ -198,6 +198,8 @@ xnestCollectEvents(void)
     case DestroyNotify:
       if (xnestParentWindow != (Window) 0 &&
 	  X.xdestroywindow.window == xnestParentWindow)
+	CloseWellKnownConnections();
+	OsCleanup(1);
 	exit (0);
       break;
 


More information about the Xquartz-changes mailing list