From bdeb9298b487505a18feac691056e565ec557bd7 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 8 Aug 2019 00:26:11 +0200 Subject: [PATCH] Allow poll() to be interrupted --- src/vpn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vpn.c b/src/vpn.c index 14301e6..95f4752 100644 --- a/src/vpn.c +++ b/src/vpn.c @@ -358,7 +358,7 @@ static int event_loop(Context *context) return -2; } if ((found_fds = poll(fds, POLLFD_COUNT, 1500)) == -1) { - return -1; + return errno == EINTR ? 0 : -1; } if (fds[POLLFD_LISTENER].revents & POLLIN) { new_client_fd = tcp_accept(context, context->listen_fd);