From a61b1a72dc91503b34e3260262fb201191fab887 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Wed, 31 Oct 2018 23:43:58 +0100 Subject: XlibInt.c: fix wrong debug message --- nx-X11/lib/src/XlibInt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/lib/src/XlibInt.c b/nx-X11/lib/src/XlibInt.c index 119126d3d..88698daa3 100644 --- a/nx-X11/lib/src/XlibInt.c +++ b/nx-X11/lib/src/XlibInt.c @@ -875,7 +875,7 @@ void _XSeqSyncFunction( if (dpy->flags & XlibDisplayIOError) { #ifdef NX_TRANS_DEBUG - fprintf(stderr, "_XSeqSyncFunction: Returning 0 with I/O error detected.\n"); + fprintf(stderr, "_XSeqSyncFunction: Returning with I/O error detected.\n"); #endif return; } -- cgit v1.2.3 From 633f4617b6720bcac8e0ead9e46fd14b60d598e6 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Wed, 31 Oct 2018 23:44:15 +0100 Subject: XlibInt: check for XlibError before accessing other dpy fields This fixes an assertion being triggered on reconnect: assertion=assertion@entry=0x7f2f0bba6510 "(dpy->flags & XlibDisplayPrivSync) != 0", file=file@entry=0x7f2f0bba62fc "XlibInt.c", line=line@entry=895, --- nx-X11/lib/src/XlibInt.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nx-X11/lib/src/XlibInt.c b/nx-X11/lib/src/XlibInt.c index 88698daa3..36e650193 100644 --- a/nx-X11/lib/src/XlibInt.c +++ b/nx-X11/lib/src/XlibInt.c @@ -892,6 +892,16 @@ void _XSeqSyncFunction( static int _XPrivSyncFunction (Display *dpy) { +#ifdef NX_TRANS_SOCKET + if (dpy->flags & XlibDisplayIOError) + { +#ifdef NX_TRANS_DEBUG + fprintf(stderr, "%s: Returning 0 with I/O error detected.\n", __func__); +#endif + return 0; + } +#endif /* NX_TRANS_SOCKET */ + #ifdef XTHREADS assert(!dpy->lock_fns); #endif -- cgit v1.2.3