diff options
| author | Zach DeCook <zachdecook@librem.one> | 2024-01-29 20:59:54 -0500 |
|---|---|---|
| committer | Zach DeCook <zachdecook@librem.one> | 2024-01-29 20:59:54 -0500 |
| commit | 5dde096498a6c078901a6ea8ad922932e7693f09 (patch) | |
| tree | c93a42c80f2d15bf9da3207eec2a9ec4dc74d742 | |
| parent | 72b46219c2adc1908df98203ebc0d4f48351d3ee (diff) | |
| download | suggpicker-0.1.4.tar.gz | |
event loop: exit if the wayland socket disappears v0.1.4
(prevents infinite loop when your compositor crashes)
| -rw-r--r-- | config.mk | 2 | ||||
| -rw-r--r-- | main.c | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/config.mk b/config.mk index 4ccabcf..fd9f467 100644 --- a/config.mk +++ b/config.mk @@ -1,2 +1,2 @@ -VERSION = 0.1.3 +VERSION = 0.1.4 CFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=700 diff --git a/main.c b/main.c index 2bedc63..39d8cea 100644 --- a/main.c +++ b/main.c @@ -549,6 +549,12 @@ main(int argc, char **argv) { if (fds[WAYLAND_FD].revents & POLLIN) { wl_display_dispatch(display); } + if (fds[WAYLAND_FD].revents & POLLERR) { + die("Exceptional condition on wayland socket.\n"); + } + if (fds[WAYLAND_FD].revents & POLLHUP) { + die("Wayland socket has been disconnected.\n"); + } if (fds[SIGNAL_FD].revents & POLLIN) { struct signalfd_siginfo si; |
