From 9f9c5365816bdd036fd80d54b22e86764ea4b7a7 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 14 Jun 2019 17:55:14 +0200 Subject: Add XSetIOErrorExitHandler() function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This function complements XSetIOErrorHandler(), allowing to override the default behavior that trusts on I/O errors never coming back (i.e. exit()ing the process). This is meant as a mechanism for Wayland compositors (that are too a X11 client + compositing manager) to unfasten seatbelts and jump through the car window. It might get lucky and land on a stack of pillows. In consequence, some functions labeled as _X_NORETURN can as a matter of fact return. So those hints were removed. Signed-off-by: Carlos Garnacho Reviewed-by: Michel Dänzer --- man/XSetErrorHandler.man | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'man') diff --git a/man/XSetErrorHandler.man b/man/XSetErrorHandler.man index 6ab5ae46..2f30420f 100644 --- a/man/XSetErrorHandler.man +++ b/man/XSetErrorHandler.man @@ -47,7 +47,7 @@ .ds xC Inter-Client Communication Conventions Manual .TH XSetErrorHandler __libmansuffix__ __xorgversion__ "XLIB FUNCTIONS" .SH NAME -XSetErrorHandler, XGetErrorText, XDisplayName, XSetIOErrorHandler, XGetErrorDatabaseText \- default error handlers +XSetErrorHandler, XGetErrorText, XDisplayName, XSetIOErrorHandler, XSetIOErrorExitHandler, XGetErrorDatabaseText \- default error handlers .SH SYNTAX .HP int (*XSetErrorHandler\^(\^int (\^*\^\fIhandler\fP\^)\^(Display *, XErrorEvent @@ -61,6 +61,10 @@ char *XDisplayName\^(\^_Xconst char *\fIstring\fP\^); int (*XSetIOErrorHandler\^(\^int (\^*\^\fIhandler\fP\^)(Display *)\^)\^)\^(\^); .HP +void (*XSetIOErrorExitHandler\^(Display +*\fIdisplay\fP\^, void (\^*\^\fIhandler\fP\^)(Display *, void +*)\^, void *\fIuser_data\fP)\^)\^(\^); +.HP int XGetErrorDatabaseText\^(\^Display *\fIdisplay\fP\^, _Xconst char *\fIname\fP, _Xconst char *\fImessage\fP\^, _Xconst char *\fIdefault_string\fP\^, char *\fIbuffer_return\fP\^, int \fIlength\fP\^); @@ -136,9 +140,11 @@ sets the fatal I/O error handler. Xlib calls the program's supplied error handler if any sort of system call error occurs (for example, the connection to the server was lost). This is assumed to be a fatal condition, -and the called routine should not return. +and the called routine should normally not return. If the I/O error handler does return, -the client process exits. +the client process exits by default, this behavior may be altered with the +.BR XSetIOErrorExitHandler +function. .LP Note that the previous error handler is returned. .LP -- cgit v1.2.1