Skip to content

Commit

Permalink
Add error when wayland connection fails
Browse files Browse the repository at this point in the history
  • Loading branch information
mmhobi7 authored Jan 19, 2022
1 parent 6937fee commit f74d4d9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion oguri.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,10 @@ int main(int argc, char * argv[]) {
signal(SIGPIPE, SIG_IGN);

oguri.display = wl_display_connect(NULL);
assert(oguri.display);
if (!oguri.display) {
fprintf(stderr, "Unable to create wayland display connection. Is wayland running?\n");
return 1;
}

oguri.events[OGURI_SIGNAL_EVENT] = (struct pollfd) {
.fd = signal_pipe[0],
Expand Down

0 comments on commit f74d4d9

Please sign in to comment.