diff options
author | runge <runge> | 2007-05-19 03:17:58 +0000 |
---|---|---|
committer | runge <runge> | 2007-05-19 03:17:58 +0000 |
commit | e9353e8d2919a6f2947602cb3c42317d82fb26d8 (patch) | |
tree | 11be3eda448693ce3fc472d99026f4a39520b5f3 /x11vnc/x11vnc.c | |
parent | 13ad9f494048fbcc983f580caaec0119153f29c8 (diff) | |
download | libtdevnc-e9353e8d2919a6f2947602cb3c42317d82fb26d8.tar.gz libtdevnc-e9353e8d2919a6f2947602cb3c42317d82fb26d8.zip |
More fixes to ultra java viewer, ultrafilexfer debugging output, fix -loop in .x11vncrc case.
Diffstat (limited to 'x11vnc/x11vnc.c')
-rw-r--r-- | x11vnc/x11vnc.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/x11vnc/x11vnc.c b/x11vnc/x11vnc.c index 2d3aad0..cdf31ab 100644 --- a/x11vnc/x11vnc.c +++ b/x11vnc/x11vnc.c @@ -157,7 +157,7 @@ static int limit_shm(void); static void check_rcfile(int argc, char **argv); static void immediate_switch_user(int argc, char* argv[]); static void print_settings(int try_http, int bg, char *gui_str); -static void check_loop_mode(int argc, char* argv[]); +static void check_loop_mode(int argc, char* argv[], int force); static void check_cursor_changes(void) { @@ -782,7 +782,7 @@ static void check_rcfile(int argc, char **argv) { argv2[argc2++] = strdup(argv[0]); if (! norc) { - char line[4096], parm[100], tmp[101]; + char line[4096], parm[400], tmp[401]; char *buf, *tbuf; struct stat sbuf; int sz; @@ -873,7 +873,7 @@ static void check_rcfile(int argc, char **argv) { q++; } - if (i >= 100) { + if (i >= 400) { fprintf(stderr, "invalid rcfile line: %s/%s\n", p, buf); exit(1); @@ -884,10 +884,17 @@ static void check_rcfile(int argc, char **argv) { exit(1); } if (parm[0] == '-') { - strncpy(tmp, parm, 100); + strncpy(tmp, parm, 400); } else { tmp[0] = '-'; - strncpy(tmp+1, parm, 100); + strncpy(tmp+1, parm, 400); + } + + if (strstr(tmp, "-loop") == tmp) { + if (! getenv("X11VNC_LOOP_MODE")) { + check_loop_mode(argc, argv, 1); + exit(0); + } } argv2[argc2++] = strdup(tmp); @@ -1306,10 +1313,13 @@ static void print_settings(int try_http, int bg, char *gui_str) { } -static void check_loop_mode(int argc, char* argv[]) { +static void check_loop_mode(int argc, char* argv[], int force) { int i; int loop_mode = 0, loop_sleep = 2000, loop_max = 0; + if (force) { + loop_mode = 1; + } for (i=1; i < argc; i++) { char *p = argv[i]; if (strstr(p, "--") == p) { @@ -1562,7 +1572,7 @@ int main(int argc, char* argv[]) { /* check for -loop mode: */ - check_loop_mode(argc, argv); + check_loop_mode(argc, argv, 0); dtime0(&x11vnc_start); @@ -1773,14 +1783,6 @@ int main(int argc, char* argv[]) { connect_once = 0; } else if (strstr(arg, "-loop") == arg) { ; /* handled above */ -#if LIBVNCSERVER_HAVE_SETSID - bg = 1; - opts_bg = bg; -#else - fprintf(stderr, "warning: -bg mode not supported.\n"); -#endif - } else if (strstr(arg, "-loop") == arg) { - ; /* handled above */ } else if (!strcmp(arg, "-timeout")) { CHECK_ARGC first_conn_timeout = atoi(argv[++i]); |