diff options
author | Johannes Löthberg <johannes@kyriasis.com> | 2015-02-16 21:50:35 +0100 |
---|---|---|
committer | Johannes Löthberg <johannes@kyriasis.com> | 2015-02-16 21:50:35 +0100 |
commit | 0a03e38bc37cdbd54de75691fb9ee9f236ef46c7 (patch) | |
tree | edb18dc04834261bc90fe960836de19f31b14dc0 | |
parent | 31af56456837d1023b1ae30b098d7f385c4bc984 (diff) | |
download | yawa-0a03e38bc37cdbd54de75691fb9ee9f236ef46c7.tar.xz |
Print error and exit when can't open display
-rw-r--r-- | src/yawa.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -305,6 +305,10 @@ main(signed argc, char **argv) Pixmap pixmap; Imlib_Color_Modifier modifier = NULL; _display = XOpenDisplay(NULL); + if (!_display) { + fprintf(stderr, "X display could not be opened\n"); + exit(1); + } for (screen = 0; screen < ScreenCount(_display); screen++) { display = XOpenDisplay(NULL); |