From 2bf76009e1d279a4194d37b9ee4f2bf0d9424d62 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 29 Jul 2021 09:08:39 +0200 Subject: [PATCH] Check for poll errors --- loop.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/loop.c b/loop.c index 5cce867..674b310 100644 --- a/loop.c +++ b/loop.c @@ -81,7 +81,11 @@ void loop_poll(struct loop *loop) { ms = 0; } - poll(loop->fds, loop->fd_length, ms); + int ret = poll(loop->fds, loop->fd_length, ms); + if (ret < 0) { + swaylock_log_errno(LOG_ERROR, "poll failed"); + exit(1); + } // Dispatch fds size_t fd_index = 0;