Don't wake up without paths

Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
This commit is contained in:
Adrien Gallouët
2019-03-09 14:39:22 +00:00
parent 0dddca3b61
commit 159104ce9c
2 changed files with 3 additions and 3 deletions

2
mud

Submodule mud updated: eab4cdb1ad...f67a5b4fed

View File

@@ -207,7 +207,7 @@ gt_bind(int argc, char **argv)
unsigned char buf[4096];
while (!gt_quit) {
unsigned long send_wait = mud_send_wait(mud);
long send_wait = mud_send_wait(mud);
if (send_wait) {
FD_CLR(tun_fd, &rfds);
@@ -223,7 +223,7 @@ gt_bind(int argc, char **argv)
.tv_usec = send_wait,
};
const int ret = select(last_fd, &rfds, NULL, NULL, send_wait ? &tv : NULL);
const int ret = select(last_fd, &rfds, NULL, NULL, send_wait > 0 ? &tv : NULL);
if (ret == -1) {
if (errno == EBADF) {