vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit b2782f36bda2e2afc0d72aae40c05cde58458df2
parent 821a40f0907ba526f60ee73086b64097305f0791
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Thu, 23 Oct 2014 22:10:44 +0200

Use pselect instead of select

Diffstat:
Mvis.c | 9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git 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;