diff options
author | runge <runge> | 2008-10-29 23:41:28 +0000 |
---|---|---|
committer | runge <runge> | 2008-10-29 23:41:28 +0000 |
commit | 4dbc5d5a129ac009521da08bdc83eba5ea1eb51b (patch) | |
tree | c0f72b543f54996eb3ef10aab3f4207bfff33c07 /x11vnc/xevents.c | |
parent | 8938cda1e7e09d946475fddaba46194baf7e6388 (diff) | |
download | libtdevnc-4dbc5d5a129ac009521da08bdc83eba5ea1eb51b.tar.gz libtdevnc-4dbc5d5a129ac009521da08bdc83eba5ea1eb51b.zip |
x11vnc: -http_oneport for single port HTTP and VNC. Improve find_display wrt lsof blocking with -b.
Diffstat (limited to 'x11vnc/xevents.c')
-rw-r--r-- | x11vnc/xevents.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/x11vnc/xevents.c b/x11vnc/xevents.c index 32bea29..b9c8988 100644 --- a/x11vnc/xevents.c +++ b/x11vnc/xevents.c @@ -1508,6 +1508,7 @@ static void try_local_chat_window(void) { int i, port, lsock; char cmd[100]; struct sockaddr_in addr; + pid_t pid = -1; #ifdef __hpux int addrlen = sizeof(addr); #else @@ -1532,7 +1533,9 @@ static void try_local_chat_window(void) { sprintf(cmd, "ssvnc -cmd VNC://localhost:%d -chatonly", port); - pid_t pid = fork(); +#if LIBVNCSERVER_HAVE_FORK + pid = fork(); +#endif if (pid == -1) { perror("fork"); @@ -1542,14 +1545,19 @@ static void try_local_chat_window(void) { int d; args[0] = "/bin/sh"; args[1] = "-c"; - /* "ssvnc -cmd VNC://fd=0 -chatonly"; */ + /* "ssvnc -cmd VNC://fd=0 -chatonly"; not working */ args[2] = cmd; args[3] = NULL; + set_env("VNCVIEWER_PASSWORD", "moo"); +#if !NO_X11 + if (dpy != NULL) { + set_env("DISPLAY", DisplayString(dpy)); + } +#endif for (d = 3; d < 256; d++) { close(d); } - set_env("VNCVIEWER_PASSWORD", "moo"); execvp(args[0], args); perror("exec"); |