From 6f43791ebc3cfceedf6fb8dace6210dbae7885be Mon Sep 17 00:00:00 2001 From: frekky Date: Sun, 7 Feb 2016 21:59:59 +0800 Subject: [PATCH] Fixed bug causing select invalid argument on iodined --- src/window.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/window.c b/src/window.c index 3fe3c09..a3bd346 100644 --- a/src/window.c +++ b/src/window.c @@ -273,8 +273,13 @@ window_sending(struct frag_buffer *w, struct timeval *nextresend) oldest.tv_sec = 0; oldest.tv_usec = 0; - if (w->numitems == 0) + if (w->numitems == 0) { + if (nextresend) { + nextresend->tv_sec = 0; + nextresend->tv_usec = 0; + } return 0; + } gettimeofday(&now, NULL);