[Xcb-commit] xcb-demo xcbrandr.c,1.2,1.3
Bart Massey
xcb-commit at lists.freedesktop.org
Sun Dec 11 13:10:07 PST 2005
Update of /cvs/xcb/xcb-demo
In directory gabe:/tmp/cvs-serv24528
Modified Files:
xcbrandr.c
Log Message:
Keep xcbrandr from dumping core or otherwise botching trying
to print a display_name if none was found.
Index: xcbrandr.c
===================================================================
RCS file: /cvs/xcb/xcb-demo/xcbrandr.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- xcbrandr.c 8 Dec 2005 05:54:52 -0000 1.2
+++ xcbrandr.c 11 Dec 2005 21:10:05 -0000 1.3
@@ -217,6 +217,12 @@
if (verbose) query = 1;
+ if (!display_name)
+ display_name = getenv("DISPLAY");
+ if (!display_name) {
+ fprintf (stderr, "No display available\n");
+ exit (1);
+ }
c = XCBConnect(display_name, &screen);
if (!c) {
fprintf (stderr, "Can't open display %s\n", display_name);
More information about the xcb-commit
mailing list