From 832e6f1370ec70ec654aa4c80a253fd0333e5392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Fri, 10 Jan 2020 19:22:59 +0100 Subject: [PATCH] wayland: make wayland socket non-blocking --- wayland.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wayland.c b/wayland.c index 2b950056..72e92bbb 100644 --- a/wayland.c +++ b/wayland.c @@ -720,6 +720,12 @@ wayl_init(const struct config *conf, struct fdm *fdm) /* All wayland initialization done - make it so */ wl_display_roundtrip(wayl->display); + int wl_fd = wl_display_get_fd(wayl->display); + if (fcntl(wl_fd, F_SETFL, fcntl(wl_fd, F_GETFL) | O_NONBLOCK) < 0) { + LOG_ERRNO("failed to make Wayland socket non-blocking"); + goto out; + } + wayl->kbd.repeat.fd = timerfd_create(CLOCK_BOOTTIME, TFD_CLOEXEC | TFD_NONBLOCK); if (wayl->kbd.repeat.fd == -1) { LOG_ERRNO("failed to create keyboard repeat timer FD");