aboutsummaryrefslogtreecommitdiff
path: root/vis.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2014-10-23 22:10:44 +0200
committerMarc André Tanner <mat@brain-dump.org>2014-10-23 22:10:44 +0200
commit0984133231cae95d2237c066aefff996cc0cb6b3 (patch)
tree73ea81029cb061070a4d746dc93dc1226e01c6ab /vis.c
parentebde7690075525341f9a90a000dcd4a569b0350a (diff)
downloadvis-0984133231cae95d2237c066aefff996cc0cb6b3.tar.gz
vis-0984133231cae95d2237c066aefff996cc0cb6b3.tar.xz
Use pselect instead of select
Diffstat (limited to 'vis.c')
-rw-r--r--vis.c9
1 files 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;