aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-01-10 20:33:40 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-01-10 20:33:40 +0000
commit5956faac01246521316282c26c875c21787c3add (patch)
treebed37fd75b347e084e45693d2f9ed1437377c66c
parentREADME: some terminal emulators call "server mode" "daemon mode" (diff)
term/wayland: use MONOTONIC timers
-rw-r--r--terminal.c10
-rw-r--r--wayland.c2
2 files changed, 6 insertions, 6 deletions
diff --git a/terminal.c b/terminal.c
index a48d5e41..6550b164 100644
--- a/terminal.c
+++ b/terminal.c
@@ -513,20 +513,20 @@ term_init(const struct config *conf, struct fdm *fdm, struct wayland *wayl,
LOG_ERRNO("failed to open PTY");
goto close_fds;
}
- if ((flash_fd = timerfd_create(CLOCK_BOOTTIME, TFD_CLOEXEC | TFD_NONBLOCK)) == -1) {
+ if ((flash_fd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK)) == -1) {
LOG_ERRNO("failed to create flash timer FD");
goto close_fds;
}
- if ((blink_fd = timerfd_create(CLOCK_BOOTTIME, TFD_CLOEXEC | TFD_NONBLOCK)) == -1) {
+ if ((blink_fd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK)) == -1) {
LOG_ERRNO("failed to create blink timer FD");
goto close_fds;
}
- if ((cursor_blink_fd = timerfd_create(CLOCK_BOOTTIME, TFD_CLOEXEC | TFD_NONBLOCK)) == -1) {
+ if ((cursor_blink_fd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK)) == -1) {
LOG_ERRNO("failed to create cursor blink timer FD");
goto close_fds;
}
- if ((delay_lower_fd = timerfd_create(CLOCK_BOOTTIME, TFD_CLOEXEC | TFD_NONBLOCK)) == -1 ||
- (delay_upper_fd = timerfd_create(CLOCK_BOOTTIME, TFD_CLOEXEC | TFD_NONBLOCK)) == -1)
+ if ((delay_lower_fd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK)) == -1 ||
+ (delay_upper_fd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK)) == -1)
{
LOG_ERRNO("failed to create delayed rendering timer FDs");
goto close_fds;
diff --git a/wayland.c b/wayland.c
index b60bff0e..8a9b8012 100644
--- a/wayland.c
+++ b/wayland.c
@@ -730,7 +730,7 @@ wayl_init(const struct config *conf, struct fdm *fdm)
goto out;
}
- wayl->kbd.repeat.fd = timerfd_create(CLOCK_BOOTTIME, TFD_CLOEXEC | TFD_NONBLOCK);
+ wayl->kbd.repeat.fd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK);
if (wayl->kbd.repeat.fd == -1) {
LOG_ERRNO("failed to create keyboard repeat timer FD");
goto out;