commit b9e077813144354ef11e5988b93ed59beca45a38
parent fa3a678a65b6b857c2db10bf0c30d6b38be17af0
Author: sin <sin@2f30.org>
Date: Tue, 12 Apr 2016 23:08:25 +0100
relax error handling
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tunnel.c b/tunnel.c
@@ -17,8 +17,10 @@ tunnel(int netfd, int devfd)
pfd[1].fd = devfd;
pfd[1].events = POLLIN;
for (;;) {
- if (poll(pfd, 2, -1) < 0)
- logerr("poll failed");
+ if (poll(pfd, 2, -1) < 0) {
+ logwarn("poll failed");
+ return -1;
+ }
if (pfd[0].revents & (POLLIN | POLLHUP)) {
n = netread(netfd, buf, sizeof(buf), &outlen);