From: Brian Date: Wed, 13 Dec 2006 15:30:26 +0000 (-0700) Subject: Use XDisplayName() when reporting errors (bug 8079). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=73eee2402eec80b745141689ecff2d4ecf36035e;p=mesa.git Use XDisplayName() when reporting errors (bug 8079). --- diff --git a/progs/xdemos/glthreads.c b/progs/xdemos/glthreads.c index 83413383dd4..989697fbcaa 100644 --- a/progs/xdemos/glthreads.c +++ b/progs/xdemos/glthreads.c @@ -473,7 +473,7 @@ main(int argc, char *argv[]) dpy = XOpenDisplay(displayName); if (!dpy) { - fprintf(stderr, "Unable to open display %s\n", displayName); + fprintf(stderr, "Unable to open display %s\n", XDisplayName(displayName)); return -1; } } diff --git a/progs/xdemos/glxcontexts.c b/progs/xdemos/glxcontexts.c index fbc296ef625..a9ff326ed5e 100644 --- a/progs/xdemos/glxcontexts.c +++ b/progs/xdemos/glxcontexts.c @@ -587,8 +587,8 @@ main(int argc, char *argv[]) dpy = XOpenDisplay(dpyName); if (!dpy) { - printf("Error: couldn't open display %s\n", - dpyName ? dpyName : getenv("DISPLAY")); + fprintf(stderr, "Error: couldn't open display %s\n", + XDisplayName(dpyName)); return -1; } diff --git a/progs/xdemos/glxgears_fbconfig.c b/progs/xdemos/glxgears_fbconfig.c index acbadd21ac5..2dac00b75d1 100644 --- a/progs/xdemos/glxgears_fbconfig.c +++ b/progs/xdemos/glxgears_fbconfig.c @@ -575,7 +575,7 @@ main(int argc, char *argv[]) dpy = XOpenDisplay(dpyName); if (!dpy) { - printf("Error: couldn't open display %s\n", dpyName); + printf("Error: couldn't open display %s\n", XDisplayName(dpyName)); return -1; } diff --git a/progs/xdemos/glxheads.c b/progs/xdemos/glxheads.c index 0145a70e91c..b3290e90d51 100644 --- a/progs/xdemos/glxheads.c +++ b/progs/xdemos/glxheads.c @@ -57,7 +57,7 @@ static int NumHeads = 0; static void Error(const char *display, const char *msg) { - fprintf(stderr, "Error on display %s - %s\n", display, msg); + fprintf(stderr, "Error on display %s - %s\n", XDisplayName(display), msg); exit(1); } diff --git a/progs/xdemos/glxinfo.c b/progs/xdemos/glxinfo.c index a1aca5ad31e..3e8e0be5203 100644 --- a/progs/xdemos/glxinfo.c +++ b/progs/xdemos/glxinfo.c @@ -939,7 +939,7 @@ main(int argc, char *argv[]) dpy = XOpenDisplay(displayName); if (!dpy) { - fprintf(stderr, "Error: unable to open display %s\n", displayName); + fprintf(stderr, "Error: unable to open display %s\n", XDisplayName(displayName)); return -1; } diff --git a/progs/xdemos/glxswapcontrol.c b/progs/xdemos/glxswapcontrol.c index 0ed5ebe4722..d9be984be57 100644 --- a/progs/xdemos/glxswapcontrol.c +++ b/progs/xdemos/glxswapcontrol.c @@ -749,7 +749,7 @@ main(int argc, char *argv[]) dpy = XOpenDisplay(dpyName); if (!dpy) { - printf("Error: couldn't open display %s\n", dpyName); + printf("Error: couldn't open display %s\n", XDisplayName(dpyName)); return -1; } diff --git a/progs/xdemos/manywin.c b/progs/xdemos/manywin.c index c9cca751341..cfea555210a 100644 --- a/progs/xdemos/manywin.c +++ b/progs/xdemos/manywin.c @@ -59,7 +59,7 @@ static GLuint TexObj = 0; static void Error(const char *display, const char *msg) { - fprintf(stderr, "Error on display %s - %s\n", display, msg); + fprintf(stderr, "Error on display %s - %s\n", XDisplayName(display), msg); exit(1); } diff --git a/progs/xdemos/opencloseopen.c b/progs/xdemos/opencloseopen.c index 2e4de24c71d..0b8d0618431 100644 --- a/progs/xdemos/opencloseopen.c +++ b/progs/xdemos/opencloseopen.c @@ -91,7 +91,7 @@ make_window( const char * dpyName, const char *name, dpy = XOpenDisplay(dpyName); if (!dpy) { - printf("Error: couldn't open display %s\n", dpyName); + printf("Error: couldn't open display %s\n", XDisplayName(dpyName)); exit(1); } diff --git a/progs/xdemos/pbinfo.c b/progs/xdemos/pbinfo.c index 88d93c8da62..b43adf1bb70 100644 --- a/progs/xdemos/pbinfo.c +++ b/progs/xdemos/pbinfo.c @@ -95,7 +95,7 @@ main(int argc, char *argv[]) dpy = XOpenDisplay(dpyName); if (!dpy) { - printf("Error: couldn't open display %s\n", dpyName ? dpyName : ":0"); + printf("Error: couldn't open display %s\n", XDisplayName(dpyName)); return 1; } diff --git a/progs/xdemos/yuvrect_client.c b/progs/xdemos/yuvrect_client.c index 48f82cb7599..e2b79a7c0e1 100644 --- a/progs/xdemos/yuvrect_client.c +++ b/progs/xdemos/yuvrect_client.c @@ -296,7 +296,7 @@ main(int argc, char *argv[]) dpy = XOpenDisplay(dpyName); if (!dpy) { printf("Error: couldn't open display %s\n", - dpyName ? dpyName : getenv("DISPLAY")); + XDisplayName(dpyName)); return -1; }