From a6fe8f392cb5fcc2fde206b41a4fd0230df348ab Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Mon, 28 Apr 2014 13:33:40 +1000 Subject: [PATCH] Sleep briefly, don't poll when no fds are present --- src/connector.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/connector.c b/src/connector.c index deecffd9..486a9a7e 100644 --- a/src/connector.c +++ b/src/connector.c @@ -193,7 +193,11 @@ retry: } ck_runlock(&ci->lock); - ret = poll(fds, nfds, 60000); + if (!nfds) { + cksleep_ms(100); + goto retry; + } + ret = poll(fds, nfds, 1000); if (ret < 0) { if (interrupted()) goto retry;