From 101602413fe057426c1aed2eb8c9f97e84cbf040 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 12 Dec 2008 18:01:25 +0000 Subject: Misc fixes for ZDS compile/build git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1451 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/netutils/resolv/resolv.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'nuttx/netutils/resolv') diff --git a/nuttx/netutils/resolv/resolv.c b/nuttx/netutils/resolv/resolv.c index 4ac604fb6..aac9ee49e 100644 --- a/nuttx/netutils/resolv/resolv.c +++ b/nuttx/netutils/resolv/resolv.c @@ -344,15 +344,16 @@ int recv_response(struct sockaddr_in *addr) /* Get the binding for name. */ #ifdef CONFIG_NET_IPv6 -int resolv_query(const char *name, struct sockaddr_in6 *addr) +int resolv_query(FAR const char *name, FAR struct sockaddr_in6 *addr) #else -int resolv_query(const char *name, struct sockaddr_in *addr) +int resolv_query(FAR const char *name, FAR struct sockaddr_in *addr) #endif { int retries; int ret; - // Loop while receive timeout errors occur and there are remaining retries + /* Loop while receive timeout errors occur and there are remaining retries */ + for (retries = 0; retries < 3; retries++) { if (send_query(name, addr) < 0) @@ -364,16 +365,19 @@ int resolv_query(const char *name, struct sockaddr_in *addr) if (ret >= 0) { /* Response received successfully */ + return OK; } - else if (*get_errno_ptr() != EAGAIN) + else if (errno != EAGAIN) { /* Some failure other than receive timeout occurred */ + return ERROR; } } - return ret; + + return ERROR; } /* Obtain the currently configured DNS server. */ -- cgit v1.2.3