summaryrefslogtreecommitdiff
path: root/zwgc/X_driver.c
diff options
context:
space:
mode:
authorGravatar John Kohl <jtkohl@mit.edu>1989-11-29 07:06:18 +0000
committerGravatar John Kohl <jtkohl@mit.edu>1989-11-29 07:06:18 +0000
commit699715b0456a97c307c526beee0e24f9148cd431 (patch)
treed8994aeb11607f0b07b235fabc2af68ad2ac4412 /zwgc/X_driver.c
parentb404634271383f8a8245616e043feefb1b840525 (diff)
add X IO Error handler
Diffstat (limited to 'zwgc/X_driver.c')
-rw-r--r--zwgc/X_driver.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/zwgc/X_driver.c b/zwgc/X_driver.c
index b093227..7e9b7ef 100644
--- a/zwgc/X_driver.c
+++ b/zwgc/X_driver.c
@@ -287,6 +287,24 @@ int open_display_and_load_resources(pargc, argv)
return(0);
}
+/*
+ * X_driver_ioerror: called by Xlib in case of an X IO error.
+ * Shouldn't return (according to man page).
+ *
+ * on IO error, we clean up and exit.
+ *
+ * XXX it would be better to set mux_end_loop_p, but we can't return to
+ * get there (Xlib will exit if this routine returns).
+ *
+ */
+
+int X_driver_ioerror(display)
+Display *display;
+{
+ ERROR2("X IO error on display '%s'--exiting\n", display->display_name);
+ finalize_zephyr();
+ exit(1);
+}
/****************************************************************************/
/* */
/* Code to deal with initializing the driver: */
@@ -314,6 +332,8 @@ int X_driver_init(drivername, pargc, argv)
return(1);
}
+ XSetIOErrorHandler(X_driver_ioerror);
+
/*
* For now, set some useful variables using resources:
*/