[PATCH 57/65] clear timeval struct, don't use invalid wrset

From: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Sun, 5 Jul 2015 22:45:15 +0200

---
 ii.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ii.c b/ii.c
index 31a27f5..e2541cf 100644
--- a/ii.c
+++ b/ii.c
_AT_@ -691,7 +691,7 @@ static void
 run(int ircfd, const char *host)
 {
 	Channel *c;
-	fd_set rdset, wrset;
+	fd_set rdset;
 	struct timeval tv;
 	char ping_msg[IRC_MSG_MAX];
 	int r, maxfd;
_AT_@ -705,9 +705,9 @@ run(int ircfd, const char *host)
 			maxfd = MAX(c->fdin, maxfd);
 			FD_SET(c->fdin, &rdset);
 		}
+		memset(&tv, 0, sizeof(tv));
 		tv.tv_sec = 120;
-		tv.tv_usec = 0;
-		r = select(maxfd + 1, &rdset, &wrset, 0, &tv);
+		r = select(maxfd + 1, &rdset, 0, 0, &tv);
 		if(r < 0) {
 			if(errno == EINTR)
 				continue;
-- 
2.4.10
--Multipart=_Mon__9_May_2016_17_21_10_+0200_I.6cpFVydhq75aaE
Content-Type: text/x-diff;
 name="0058-set-fd-to-1-on-close.patch"
Content-Disposition: attachment;
 filename="0058-set-fd-to-1-on-close.patch"
Content-Transfer-Encoding: 7bit
Received on Mon Sep 17 2001 - 00:00:00 CEST

This archive was generated by hypermail 2.3.0 : Mon May 09 2016 - 17:24:22 CEST