aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/kdrive/ephyr/hostx.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/kdrive/ephyr/hostx.c')
-rw-r--r--xorg-server/hw/kdrive/ephyr/hostx.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/xorg-server/hw/kdrive/ephyr/hostx.c b/xorg-server/hw/kdrive/ephyr/hostx.c
index 1def0e87b..0f1ee8f4a 100644
--- a/xorg-server/hw/kdrive/ephyr/hostx.c
+++ b/xorg-server/hw/kdrive/ephyr/hostx.c
@@ -45,6 +45,7 @@
#include <stdio.h>
#include <unistd.h>
#include <string.h> /* for memset */
+#include <errno.h>
#include <time.h>
#ifndef _MSC_VER
@@ -337,6 +338,14 @@ hostx_set_title (char *title)
ephyrTitle = title;
}
+static int _X_NORETURN
+x_io_error_handler (Display *dpy) {
+ ErrorF("Lost connection to X server: %s\n", strerror(errno));
+ CloseWellKnownConnections();
+ OsCleanup(1);
+ exit(1);
+}
+
int
hostx_init (void)
{
@@ -364,6 +373,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);