aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2015-02-16 21:50:35 +0100
committerJohannes Löthberg <johannes@kyriasis.com>2015-02-16 21:50:35 +0100
commit0a03e38bc37cdbd54de75691fb9ee9f236ef46c7 (patch)
treeedb18dc04834261bc90fe960836de19f31b14dc0 /src
parent31af56456837d1023b1ae30b098d7f385c4bc984 (diff)
downloadyawa-0a03e38bc37cdbd54de75691fb9ee9f236ef46c7.tar.xz
Print error and exit when can't open display
Diffstat (limited to 'src')
-rw-r--r--src/yawa.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/yawa.c b/src/yawa.c
index ac52c00..ff68732 100644
--- a/src/yawa.c
+++ b/src/yawa.c
@@ -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);