aboutsummaryrefslogtreecommitdiff
path: root/wayland.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-11-02 00:44:01 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-11-02 00:44:01 +0000
commitf28fb6c039e62fe81cb610365f1801645860ceda (patch)
tree37c03ac7ade99bffc0b48c16eafdea62717c1314 /wayland.c
parentshm: purge buffers *before* we (maybe) return one from the cache (diff)
timerfd: read() returns -1 with errno == EAGAIN, not 0
When there hasn't been a timeout (or in our case, there was a timeout, but we reset the timer before we got to the read()), read() returns, not 0, but -1 with errno == EAGAIN.
Diffstat (limited to 'wayland.c')
-rw-r--r--wayland.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/wayland.c b/wayland.c
index ad8211b7..2bbf8c2e 100644
--- a/wayland.c
+++ b/wayland.c
@@ -407,15 +407,13 @@ fdm_repeat(struct fdm *fdm, int fd, int events, void *data)
wayl->kbd.repeat.fd, &expiration_count, sizeof(expiration_count));
if (ret < 0) {
+ if (errno == EAGAIN)
+ return true;
+
LOG_ERRNO("failed to read repeat key from repeat timer fd");
return false;
}
- if (ret == 0) {
- /* Cancelled by other handler in *this* epoll() iteration */
- return true;
- }
-
wayl->kbd.repeat.dont_re_repeat = true;
for (size_t i = 0; i < expiration_count; i++)
input_repeat(wayl, wayl->kbd.repeat.key);