From: Simon Ruderich Date: Sun, 3 Nov 2013 05:51:18 +0000 (+0100) Subject: tlsproxyhelper.c: Split POLLERR and POLLHUP check. X-Git-Url: https://ruderich.org/simon/gitweb/?p=tlsproxy%2Ftlsproxy.git;a=commitdiff_plain;h=418f9d30e80201a64b9b9dd0f85616a6186cb15c tlsproxyhelper.c: Split POLLERR and POLLHUP check. --- diff --git a/lib/tlsproxyhelper.c b/lib/tlsproxyhelper.c index 68dcbb5..53dc9e8 100644 --- a/lib/tlsproxyhelper.c +++ b/lib/tlsproxyhelper.c @@ -272,8 +272,12 @@ static int poll_for(int sockfd, int mode) { return -1; } - if (fds[0].revents & POLLERR || fds[0].revents & POLLHUP) { - fprintf(stderr, LOG_PREFIX "poll(): POLLERR | POLLHUP\n"); + if (fds[0].revents & POLLERR) { + fprintf(stderr, LOG_PREFIX "poll(): POLLERR\n"); + return -1; + } + if (fds[0].revents & POLLHUP) { + fprintf(stderr, LOG_PREFIX "poll(): POLLHUP\n"); return -1; }