From 0984133231cae95d2237c066aefff996cc0cb6b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Thu, 23 Oct 2014 22:10:44 +0200 Subject: Use pselect instead of select --- vis.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/vis.c b/vis.c index fde2b68..c801401 100644 --- a/vis.c +++ b/vis.c @@ -1591,8 +1591,13 @@ static Key getkey(void) { } static void mainloop() { - struct timeval idle = { .tv_usec = 0 }, *timeout = NULL; + struct timespec idle = { .tv_nsec = 0 }, *timeout = NULL; Key key, key_prev, *key_mod = NULL; + sigset_t emptyset, blockset; + sigemptyset(&emptyset); + sigemptyset(&blockset); + sigaddset(&blockset, SIGWINCH); + sigprocmask(SIG_BLOCK, &blockset, NULL); while (running) { if (screen.need_resize) { @@ -1607,7 +1612,7 @@ static void mainloop() { editor_update(vis); doupdate(); idle.tv_sec = mode->idle_timeout; - int r = select(1, &fds, NULL, NULL, timeout); + int r = pselect(1, &fds, NULL, NULL, timeout, &emptyset); if (r == -1 && errno == EINTR) continue; -- cgit v1.2.3