Browse Source

check for EINTR and resume polling

Eugene Yakubovich 10 years ago
parent
commit
5e7b87731a
1 changed files with 3 additions and 0 deletions
  1. 3 0
      udp/proxy.c

+ 3 - 0
udp/proxy.c

@@ -400,6 +400,9 @@ void run_proxy(int tun, int sock, int ctl, in_addr_t tun_ip, size_t tun_mtu, int
 	while( !exit_flag ) {
 	while( !exit_flag ) {
 		int nfds = poll(fds, 3, -1);
 		int nfds = poll(fds, 3, -1);
 		if( nfds < 0 ) {
 		if( nfds < 0 ) {
+			if( errno == EINTR )
+				continue;
+
 			log_error("Poll failed: %s\n", strerror(errno));
 			log_error("Poll failed: %s\n", strerror(errno));
 			exit(1);
 			exit(1);
 		}
 		}