diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-12-12 18:01:25 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-12-12 18:01:25 +0000 |
commit | 101602413fe057426c1aed2eb8c9f97e84cbf040 (patch) | |
tree | eac0322d111158c9c833edc48af86094f26c1e1a /nuttx/netutils/resolv | |
parent | 40a989872556404606daa6f25ff8ea4df9ad169c (diff) | |
download | px4-nuttx-101602413fe057426c1aed2eb8c9f97e84cbf040.tar.gz px4-nuttx-101602413fe057426c1aed2eb8c9f97e84cbf040.tar.bz2 px4-nuttx-101602413fe057426c1aed2eb8c9f97e84cbf040.zip |
Misc fixes for ZDS compile/build
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1451 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/netutils/resolv')
-rw-r--r-- | nuttx/netutils/resolv/resolv.c | 14 |
1 files changed, 9 insertions, 5 deletions
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. */ |