dvtm

dynamic virtual terminal manager - with my changes
git clone https://pi.duncano.de/git/dvtm.git
Log | Files | Refs | README | LICENSE

commit 3b084ae3bd9cc542bccd7e34ef17a3d51d213e77
parent 07bc7340e724f4ffd1f3ac46d15de6f0d07bcdc7
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Thu, 16 Oct 2014 21:18:09 +0200

Use pselect instead of select

Diffstat:
dvtm.c | 10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/dvtm.c b/dvtm.c @@ -11,6 +11,7 @@ * See LICENSE for details. */ +#include <sys/select.h> #include <sys/stat.h> #include <sys/ioctl.h> #include <sys/wait.h> @@ -1450,12 +1451,19 @@ main(int argc, char *argv[]) { KeyCombo keys; unsigned int key_index = 0; memset(keys, 0, sizeof(keys)); + sigset_t emptyset, blockset; if (!parse_args(argc, argv)) { setup(); startup(NULL); } + sigemptyset(&emptyset); + sigemptyset(&blockset); + sigaddset(&blockset, SIGWINCH); + sigaddset(&blockset, SIGCHLD); + sigprocmask(SIG_BLOCK, &blockset, NULL); + while (running) { int r, nfds = 0; fd_set rd; @@ -1494,7 +1502,7 @@ main(int argc, char *argv[]) { } doupdate(); - r = select(nfds + 1, &rd, NULL, NULL, NULL); + r = pselect(nfds + 1, &rd, NULL, NULL, NULL, &emptyset); if (r == -1 && errno == EINTR) continue;