diff options
Diffstat (limited to 'mainloop.c')
-rw-r--r-- | mainloop.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -22,6 +22,7 @@ #include <stdlib.h> #include <errno.h> #include <unistd.h> +#include <signal.h> #include <sys/epoll.h> #include "mainloop.h" @@ -56,6 +57,17 @@ int mainloop(unsigned int timeout) return -1; } + /* + * A timeout occured. Let's send to ourself a SIGWINCH + * so the window get refreshed automatically. No need + * to use exported functions and this code stay self + * contained. + */ + if (!nfds) { + kill(getpid(), SIGWINCH); + continue; + } + for (i = 0; i < nfds; i++) { md = events[i].data.ptr; |