[PATCH] Xephyr: Remove socket and its lock file on exit

Jeremy Huddleston jeremyhu at apple.com
Mon Oct 10 12:19:01 PDT 2011


https://bugs.freedesktop.org/show_bug.cgi?id=11484

Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
---
 hw/kdrive/ephyr/hostx.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

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);
-- 
1.7.5.4



More information about the xorg-devel mailing list