aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib/src/ErrHndlr.c
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/lib/src/ErrHndlr.c')
-rw-r--r--nx-X11/lib/src/ErrHndlr.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/nx-X11/lib/src/ErrHndlr.c b/nx-X11/lib/src/ErrHndlr.c
index 167a68b1e..0664ea936 100644
--- a/nx-X11/lib/src/ErrHndlr.c
+++ b/nx-X11/lib/src/ErrHndlr.c
@@ -84,3 +84,28 @@ XSetIOErrorHandler(XIOErrorHandler handler)
return (XIOErrorHandler) oldhandler;
}
+
+/*
+ * XSetIOErrorExitHandler - This procedure sets the X fatal I/O error
+ * exit function to be the specified routine. If NULL is passed in
+ * the original error exit function is restored. The default routine
+ * calls exit(3).
+ */
+void
+XSetIOErrorExitHandler(
+ Display *dpy,
+ XIOErrorExitHandler handler,
+ void *user_data)
+{
+ LockDisplay(dpy);
+
+ if (handler != NULL) {
+ dpy->exit_handler = handler;
+ dpy->exit_handler_data = user_data;
+ }
+ else {
+ dpy->exit_handler = _XDefaultIOErrorExit;
+ dpy->exit_handler_data = NULL;
+ }
+ UnlockDisplay(dpy);
+}