diff options
author | John Hawthorn <john.hawthorn@gmail.com> | 2013-12-28 15:28:53 -0800 |
---|---|---|
committer | John Hawthorn <john.hawthorn@gmail.com> | 2013-12-28 15:29:09 -0800 |
commit | 0c7a2ee97ee862fd9d50b0aabab3cf97425d7daf (patch) | |
tree | d96e12f0e96594f5404b16dbcbf119e56dbc0e61 /src | |
parent | 6040b2ef005a427190a6173427a08b38e41697b6 (diff) | |
download | mirror-meh-0c7a2ee97ee862fd9d50b0aabab3cf97425d7daf.tar.gz mirror-meh-0c7a2ee97ee862fd9d50b0aabab3cf97425d7daf.tar.bz2 mirror-meh-0c7a2ee97ee862fd9d50b0aabab3cf97425d7daf.zip |
proper error message on missing X display
assert is inappropriate here because it is optimized out when compiling
with NDEBUG
Diffstat (limited to 'src')
-rw-r--r-- | src/xlib.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -172,8 +172,11 @@ static int xquit(Display *d){ } void backend_init(){ - display = XOpenDisplay (NULL); - assert(display); + display = XOpenDisplay(NULL); + if(!display){ + fprintf(stderr, "Can't open X display.\n"); + exit(EXIT_FAILURE); + } xfd = ConnectionNumber(display); screen = DefaultScreen(display); |