update to new API

This commit is contained in:
lxsang
2020-09-13 01:46:11 +02:00
parent 63688c416f
commit a8979c48dc
7 changed files with 130 additions and 136 deletions

Binary file not shown.

View File

@@ -13,6 +13,7 @@
#include <antd/list.h>
#include <antd/bst.h>
#include <antd/utils.h>
#include "../tunnel.h"
@@ -368,8 +369,6 @@ int main(int argc, char** argv)
// now read data
while(running)
{
timeout.tv_sec = 0;
timeout.tv_usec = 500;
FD_ZERO(&fd_in);
FD_SET(fd, &fd_in);
maxfd = fd;
@@ -388,7 +387,7 @@ int main(int argc, char** argv)
}
list_free(&list);
status = select(maxfd + 1, &fd_in, NULL, NULL, &timeout);
status = select(maxfd + 1, &fd_in, NULL, NULL, NULL);
switch (status)
{
@@ -397,9 +396,6 @@ int main(int argc, char** argv)
running = 0;
break;
case 0:
timeout.tv_sec = 0;
timeout.tv_usec = 10000; // 5 ms
select(0, NULL, NULL, NULL, &timeout);
break;
// we have data
default: