Commit de95a568 authored by runge's avatar runge

x11vnc: less fprintf under -q so '-q -inetd' has no stderr output.

parent d485cebe
2004-05-13 Karl Runge <runge@karlrunge.com> 2004-05-14 Karl Runge <runge@karlrunge.com>
* improvements to -accept popup: yes/no buttons and timeout. * improvements to -accept popup: yes/no buttons and timeout.
* less fprintf under -q so '-q -inetd' has no stderr output.
2004-05-08 Karl Runge <runge@karlrunge.com> 2004-05-08 Karl Runge <runge@karlrunge.com>
* add -accept some-command/xmessage/popup to prompt local X11 user * add -accept some-command/xmessage/popup to prompt local X11 user
......
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
#endif #endif
/* date +'"lastmod: %Y-%m-%d";' */ /* date +'"lastmod: %Y-%m-%d";' */
char lastmod[] = "lastmod: 2004-05-13"; char lastmod[] = "lastmod: 2004-05-14";
/* X and rfb framebuffer */ /* X and rfb framebuffer */
...@@ -2928,8 +2928,10 @@ void set_colormap(void) { ...@@ -2928,8 +2928,10 @@ void set_colormap(void) {
} }
if (first && ncells != NCOLOR) { if (first && ncells != NCOLOR) {
fprintf(stderr, "set_colormap: number of cells is %d" if (! quiet) {
" instead of %d.\n", ncells, NCOLOR); fprintf(stderr, "set_colormap: number of cells is %d "
"instead of %d.\n", ncells, NCOLOR);
}
screen->colourMap.count = ncells; screen->colourMap.count = ncells;
} }
...@@ -2955,7 +2957,7 @@ void set_colormap(void) { ...@@ -2955,7 +2957,7 @@ void set_colormap(void) {
} }
} }
} }
if (ncells > NCOLOR) { if (ncells > NCOLOR && ! quiet) {
fprintf(stderr, "set_colormap: big problem: ncells=%d > %d\n", fprintf(stderr, "set_colormap: big problem: ncells=%d > %d\n",
ncells, NCOLOR); ncells, NCOLOR);
} }
...@@ -3014,7 +3016,9 @@ void set_visual(char *vstring) { ...@@ -3014,7 +3016,9 @@ void set_visual(char *vstring) {
XVisualInfo vinfo; XVisualInfo vinfo;
char *p; char *p;
fprintf(stderr, "set_visual: %s\n", vstring); if (! quiet) {
fprintf(stderr, "set_visual: %s\n", vstring);
}
if ((p = strchr(vstring, ':')) != NULL) { if ((p = strchr(vstring, ':')) != NULL) {
visual_depth = atoi(p+1); visual_depth = atoi(p+1);
...@@ -3090,7 +3094,9 @@ void initialize_screen(int *argc, char **argv, XImage *fb) { ...@@ -3090,7 +3094,9 @@ void initialize_screen(int *argc, char **argv, XImage *fb) {
screen = rfbGetScreen(argc, argv, fb->width, fb->height, screen = rfbGetScreen(argc, argv, fb->width, fb->height,
fb->bits_per_pixel, 8, fb->bits_per_pixel/8); fb->bits_per_pixel, 8, fb->bits_per_pixel/8);
fprintf(stderr, "\n"); if (! quiet) {
fprintf(stderr, "\n");
}
if (! screen) { if (! screen) {
int i; int i;
...@@ -3412,20 +3418,18 @@ void blackout_tiles() { ...@@ -3412,20 +3418,18 @@ void blackout_tiles() {
} }
void initialize_xinerama () { void initialize_xinerama () {
#ifdef LIBVNCSERVER_HAVE_LIBXINERAMA #ifndef LIBVNCSERVER_HAVE_LIBXINERAMA
rfbLog("Xinerama: Library libXinerama is not available to determine\n");
rfbLog("Xinerama: the head geometries, consider using -blackout\n");
rfbLog("Xinerama: if the screen is non-rectangular.\n");
#else
XineramaScreenInfo *sc, *xineramas; XineramaScreenInfo *sc, *xineramas;
#endif
sraRegionPtr black_region, tmp_region; sraRegionPtr black_region, tmp_region;
sraRectangleIterator *iter; sraRectangleIterator *iter;
sraRect rect; sraRect rect;
char *bstr, *tstr; char *bstr, *tstr;
int ev, er, i, n, rcnt; int ev, er, i, n, rcnt;
#ifndef LIBVNCSERVER_HAVE_LIBXINERAMA
rfbLog("Xinerama: Library libXinerama is not available to determine\n");
rfbLog("Xinerama: the head geometries, consider using -blackout\n");
rfbLog("Xinerama: if the screen is non-rectangular.\n");
#else
if (! XineramaQueryExtension(dpy, &ev, &er)) { if (! XineramaQueryExtension(dpy, &ev, &er)) {
rfbLog("Xinerama: disabling: display does not support it.\n"); rfbLog("Xinerama: disabling: display does not support it.\n");
xinerama = 0; xinerama = 0;
...@@ -3508,7 +3512,6 @@ void initialize_xinerama () { ...@@ -3508,7 +3512,6 @@ void initialize_xinerama () {
free(bstr); free(bstr);
free(tstr); free(tstr);
#endif #endif
} }
/* /*
...@@ -5448,6 +5451,8 @@ void print_help() { ...@@ -5448,6 +5451,8 @@ void print_help() {
" or popup is running (other clients may see no updates\n" " or popup is running (other clients may see no updates\n"
" during this period).\n" " during this period).\n"
"-inetd Launched by inetd(1): stdio instead of listening socket.\n" "-inetd Launched by inetd(1): stdio instead of listening socket.\n"
" Note: if you are not redirecting stderr to a log file\n"
" you must also specify -q as the first argument.\n"
"\n" "\n"
"-noshm Do not use the MIT-SHM extension for the polling.\n" "-noshm Do not use the MIT-SHM extension for the polling.\n"
" remote displays can be polled this way: be careful\n" " remote displays can be polled this way: be careful\n"
...@@ -5461,7 +5466,8 @@ void print_help() { ...@@ -5461,7 +5466,8 @@ void print_help() {
" together via XINERAMA, and that screen is non-rectangular\n" " together via XINERAMA, and that screen is non-rectangular\n"
" this option will try to guess the areas to black out.\n" " this option will try to guess the areas to black out.\n"
"\n" "\n"
"-q Be quiet by printing less informational output.\n" "-q Be quiet by printing less informational output to stderr.\n"
" Same as -quiet\n"
"-bg Go into the background after screen setup.\n" "-bg Go into the background after screen setup.\n"
" Something like this could be useful in a script:\n" " Something like this could be useful in a script:\n"
" port=`ssh $host \"x11vnc -display :0 -bg\" | grep PORT`\n" " port=`ssh $host \"x11vnc -display :0 -bg\" | grep PORT`\n"
...@@ -5641,7 +5647,7 @@ int limit_shm(void) { ...@@ -5641,7 +5647,7 @@ int limit_shm(void) {
} }
} }
} }
if (limit) { if (limit && ! quiet) {
fprintf(stderr, "reducing shm usage on %s %s (adding " fprintf(stderr, "reducing shm usage on %s %s (adding "
"-onetile)\n", ut.sysname, ut.release); "-onetile)\n", ut.sysname, ut.release);
} }
...@@ -5837,7 +5843,7 @@ int main(int argc, char** argv) { ...@@ -5837,7 +5843,7 @@ int main(int argc, char** argv) {
got_nevershared = 1; got_nevershared = 1;
} }
/* otherwise copy it for use below. */ /* otherwise copy it for use below. */
if (! quiet && i != pw_loc && i != pw_loc+1) { if (!quiet && !inetd && i != pw_loc && i != pw_loc+1) {
fprintf(stderr, "passing arg to libvncserver: %s\n", fprintf(stderr, "passing arg to libvncserver: %s\n",
arg); arg);
} }
...@@ -5867,7 +5873,10 @@ int main(int argc, char** argv) { ...@@ -5867,7 +5873,10 @@ int main(int argc, char** argv) {
/* fixup settings that do not make sense */ /* fixup settings that do not make sense */
if (use_threads && nofb && cursor_pos) { if (use_threads && nofb && cursor_pos) {
fprintf(stderr, "disabling -threads under -nofb -cursorpos\n"); if (! quiet) {
fprintf(stderr, "disabling -threads under -nofb "
"-cursorpos\n");
}
use_threads = 0; use_threads = 0;
} }
if (tile_fuzz < 1) { if (tile_fuzz < 1) {
...@@ -6016,8 +6025,10 @@ int main(int argc, char** argv) { ...@@ -6016,8 +6025,10 @@ int main(int argc, char** argv) {
/* check for MIT-SHM */ /* check for MIT-SHM */
if (! nofb && ! XShmQueryExtension(dpy)) { if (! nofb && ! XShmQueryExtension(dpy)) {
if (! using_shm) { if (! using_shm) {
fprintf(stderr, "warning: display does not support " if (! quiet) {
"XShm.\n"); fprintf(stderr, "warning: display does not "
"support XShm.\n");
}
} else { } else {
fprintf(stderr, "Display does not support XShm " fprintf(stderr, "Display does not support XShm "
"extension (must be local).\n"); "extension (must be local).\n");
...@@ -6032,7 +6043,9 @@ int main(int argc, char** argv) { ...@@ -6032,7 +6043,9 @@ int main(int argc, char** argv) {
/* check for XKEYBOARD */ /* check for XKEYBOARD */
if (watch_bell) { if (watch_bell) {
if (! XkbQueryExtension(dpy, &op, &ev, &er, &maj, &min)) { if (! XkbQueryExtension(dpy, &op, &ev, &er, &maj, &min)) {
fprintf(stderr, "warning: disabling bell.\n"); if (! quiet) {
fprintf(stderr, "warning: disabling bell.\n");
}
watch_bell = 0; watch_bell = 0;
} else { } else {
initialize_watch_bell(); initialize_watch_bell();
...@@ -6074,8 +6087,10 @@ int main(int argc, char** argv) { ...@@ -6074,8 +6087,10 @@ int main(int argc, char** argv) {
/* show_mouse has some segv crashes as well */ /* show_mouse has some segv crashes as well */
if (show_root_cursor) { if (show_root_cursor) {
show_root_cursor = 0; show_root_cursor = 0;
fprintf(stderr, "disabling root cursor drawing for " if (! quiet) {
"subwindow\n"); fprintf(stderr, "disabling root cursor drawing"
" for subwindow\n");
}
} }
set_offset(); set_offset();
...@@ -6201,7 +6216,9 @@ int main(int argc, char** argv) { ...@@ -6201,7 +6216,9 @@ int main(int argc, char** argv) {
int port = screen->rfbPort; int port = screen->rfbPort;
if (host != NULL) { if (host != NULL) {
/* note that vncviewer special cases 5900-5999 */ /* note that vncviewer special cases 5900-5999 */
if (quiet) { if (inetd) {
; /* should not occur */
} else if (quiet) {
if (port >= 5900) { if (port >= 5900) {
fprintf(stderr, "The VNC desktop is " fprintf(stderr, "The VNC desktop is "
"%s:%d\n", host, port - 5900); "%s:%d\n", host, port - 5900);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment