Skip to content
This repository has been archived by the owner on Aug 14, 2022. It is now read-only.

Add error when wayland connection fails #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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