diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2014-10-23 22:10:44 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2014-10-23 22:10:44 +0200 |
| commit | 0984133231cae95d2237c066aefff996cc0cb6b3 (patch) | |
| tree | 73ea81029cb061070a4d746dc93dc1226e01c6ab /vis.c | |
| parent | ebde7690075525341f9a90a000dcd4a569b0350a (diff) | |
| download | vis-0984133231cae95d2237c066aefff996cc0cb6b3.tar.gz vis-0984133231cae95d2237c066aefff996cc0cb6b3.tar.xz | |
Use pselect instead of select
Diffstat (limited to 'vis.c')
| -rw-r--r-- | vis.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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; |
