From 14cf13cfb6a6966d35348fa64e2de18deaa81f28 Mon Sep 17 00:00:00 2001 From: nohar Date: Fri, 27 May 2005 15:00:11 +0000 Subject: [PATCH] fix: wait_event now waits when there is no socket active (that happens when we to nothing but wait for a reconnect timeout to trigger) --- src/connection.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/connection.c b/src/connection.c index c7e75ea..f35b757 100644 --- a/src/connection.c +++ b/src/connection.c @@ -768,8 +768,11 @@ list_t *wait_event(list_t *cn_list, int *msec, int *nc) } /* if no connection is active, return the list... empty... */ - if (maxfd == -1) + if (maxfd == -1) { + usleep(*msec * 1000); + *msec = 0; return cn_newdata; + } tv.tv_sec = *msec / 1000; tv.tv_usec = (*msec % 1000) * 1000;