exit when display can't be opened

This commit is contained in:
Sascha Kruse 2012-07-13 10:08:14 +02:00
parent f983ba1b2a
commit 335ac3f56f

4
draw.c
View File

@ -183,8 +183,10 @@ DC *initdc(void)
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if (!(dc->dpy = XOpenDisplay(NULL))) if (!(dc->dpy = XOpenDisplay(NULL))) {
eprintf("cannot open display\n"); eprintf("cannot open display\n");
exit(EXIT_FAILURE);
}
dc->gc = XCreateGC(dc->dpy, DefaultRootWindow(dc->dpy), 0, NULL); dc->gc = XCreateGC(dc->dpy, DefaultRootWindow(dc->dpy), 0, NULL);
XSetLineAttributes(dc->dpy, dc->gc, 1, LineSolid, CapButt, JoinMiter); XSetLineAttributes(dc->dpy, dc->gc, 1, LineSolid, CapButt, JoinMiter);