aboutsummaryrefslogtreecommitdiff
path: root/terminal.c
diff options
context:
space:
mode:
Diffstat (limited to 'terminal.c')
-rw-r--r--terminal.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/terminal.c b/terminal.c
index f85a9130..2a117d5d 100644
--- a/terminal.c
+++ b/terminal.c
@@ -113,15 +113,13 @@ fdm_flash(struct fdm *fdm, int fd, int events, void *data)
term->flash.fd, &expiration_count, sizeof(expiration_count));
if (ret < 0) {
+ if (errno == EAGAIN)
+ return true;
+
LOG_ERRNO("failed to read flash timer");
return false;
}
- if (ret == 0) {
- /* Cancelled by other handler in *this* epoll() iteration */
- return true;
- }
-
LOG_DBG("flash timer expired %llu times",
(unsigned long long)expiration_count);
@@ -143,15 +141,13 @@ fdm_blink(struct fdm *fdm, int fd, int events, void *data)
term->blink.fd, &expiration_count, sizeof(expiration_count));
if (ret < 0) {
+ if (errno == EAGAIN)
+ return true;
+
LOG_ERRNO("failed to read blink timer");
return false;
}
- if (ret == 0) {
- /* Cancelled by other handler in *this* epoll() iteration */
- return true;
- }
-
LOG_DBG("blink timer expired %llu times",
(unsigned long long)expiration_count);
@@ -195,15 +191,13 @@ fdm_delayed_render(struct fdm *fdm, int fd, int events, void *data)
ret2 = read(term->delayed_render_timer.upper_fd, &unused, sizeof(unused));
if ((ret1 < 0 || ret2 < 0)) {
+ if (errno == EAGAIN)
+ return true;
+
LOG_ERRNO("failed to read timeout timer");
return false;
}
- if (ret1 == 0 && ret2 == 0) {
- /* Cancelled by other handler in *this* epoll() iteration */
- return true;
- }
-
render_refresh(term);
/* Reset timers */