From f19c170a1e5ab26c3f9309a4732af806d5e9717a Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed Date: Mon, 2 Apr 2012 14:07:19 +0200 Subject: [PATCH] zeroconf: increase wait for daemon to reduce the possibility of starting multiple daemons Change-Id: I406e5e86f1d549471d7b0f178763a4dd283e369c Reviewed-by: Christian Kandeler --- src/libs/zeroconf/embed/dnssd_clientstub.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libs/zeroconf/embed/dnssd_clientstub.c b/src/libs/zeroconf/embed/dnssd_clientstub.c index 7c6d9eaf0ba..1f57a520efd 100644 --- a/src/libs/zeroconf/embed/dnssd_clientstub.c +++ b/src/libs/zeroconf/embed/dnssd_clientstub.c @@ -220,8 +220,8 @@ static int read_all(dnssd_sock_t sd, char *buf, int len) while (len) { timeval timeout; - timeout.tv_sec = 0; - timeout.tv_usec = 100000; + timeout.tv_sec = 1; + timeout.tv_usec = 0; fd_set readFds, writeFds, exceptFds; memset(&readFds,0,sizeof(readFds)); memset(&writeFds,0,sizeof(writeFds)); @@ -233,7 +233,7 @@ static int read_all(dnssd_sock_t sd, char *buf, int len) int nVal=select(sd+1, &readFds, &writeFds, &exceptFds, &timeout); if (nVal < 1 || !FD_ISSET(sd, &readFds)) { ++nErr; - if (nErr < 5) // wait max 0.5s without reading + if (nErr < 6) // wait max 6s without reading continue; } else { num_read = recv(sd, buf, len, 0);