summaryrefslogtreecommitdiffstats
path: root/x11vnc/xwrappers.c
diff options
context:
space:
mode:
authorrunge <runge@karlrunge.com>2010-09-10 14:26:58 -0400
committerrunge <runge@karlrunge.com>2010-09-10 14:26:58 -0400
commit067a88160c994e364ebb23900228633b84f99e91 (patch)
treeaf2b04b5a044482e35fce85bc48b5504f5e8a2ea /x11vnc/xwrappers.c
parentad254469783b4720db64d8ebeeb12aeb0533e542 (diff)
downloadlibtdevnc-067a88160c994e364ebb23900228633b84f99e91.tar.gz
libtdevnc-067a88160c994e364ebb23900228633b84f99e91.zip
update to x11vnc 0.9.12
Diffstat (limited to 'x11vnc/xwrappers.c')
-rw-r--r--x11vnc/xwrappers.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/x11vnc/xwrappers.c b/x11vnc/xwrappers.c
index 6037114..667957e 100644
--- a/x11vnc/xwrappers.c
+++ b/x11vnc/xwrappers.c
@@ -1320,22 +1320,25 @@ Display *XOpenDisplay_wr(char *display_name) {
d = XOpenDisplay(display_name);
if (db) fprintf(stderr, "XOpenDisplay_wr: %s %p\n", display_name, (void *)d);
- if (d == NULL) {
- if (!getenv("NO_XAUTHLOCALHOSTNAME")) {
- if (!getenv("XAUTHLOCALHOSTNAME")) {
+ if (d == NULL && !getenv("NO_XAUTHLOCALHOSTNAME")) {
+ char *xalhn = getenv("XAUTHLOCALHOSTNAME");
+ if (1 || !xalhn) {
rfbLog("XOpenDisplay(\"%s\") failed.\n",
display_name ? display_name : "");
rfbLog("Trying again with XAUTHLOCALHOSTNAME=localhost ...\n");
set_env("XAUTHLOCALHOSTNAME", "localhost");
d = XOpenDisplay(display_name);
- if (0) {
+ if (d == NULL && xalhn) {
char *ptr = getenv("XAUTHLOCALHOSTNAME");
if (ptr) {
*(ptr-2) = '_'; /* yow */
+ rfbLog("XOpenDisplay(\"%s\") failed.\n",
+ display_name ? display_name : "");
+ rfbLog("Trying again with unset XAUTHLOCALHOSTNAME ...\n");
+ d = XOpenDisplay(display_name);
}
}
}
- }
}
xauth_raw(0);