* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: getaddrinfo.c,v 1.41.206.5 2006/01/04 23:50:21 marka Exp $ */
+/* $Id: getaddrinfo.c,v 1.41.206.6 2006/11/13 11:57:41 marka Exp $ */
#include <config.h>
* The test against 0 is there to keep the Solaris compiler
* from complaining about "end-of-loop code not reached".
*/
-#define ERR(code) \
+#define SETERROR(code) \
do { result = (code); \
if (result != 0) goto cleanup; \
} while (0)
lwres = lwres_context_create(&lwrctx, NULL, NULL, NULL, 0);
if (lwres != LWRES_R_SUCCESS)
- ERR(EAI_FAIL);
+ SETERROR(EAI_FAIL);
(void) lwres_conf_parse(lwrctx, lwres_resolv_conf);
if (hostname == NULL && (flags & AI_PASSIVE) == 0) {
ai = ai_clone(*aip, AF_INET);
if (ai == NULL) {
lwres_freeaddrinfo(*aip);
- ERR(EAI_MEMORY);
+ SETERROR(EAI_MEMORY);
}
*aip = ai;
if (lwres == LWRES_R_NOTFOUND)
goto cleanup;
else
- ERR(EAI_FAIL);
+ SETERROR(EAI_FAIL);
}
addr = LWRES_LIST_HEAD(by->addrs);
while (addr != NULL) {
ai = ai_clone(*aip, AF_INET);
if (ai == NULL) {
lwres_freeaddrinfo(*aip);
- ERR(EAI_MEMORY);
+ SETERROR(EAI_MEMORY);
}
*aip = ai;
ai->ai_socktype = socktype;
if (flags & AI_CANONNAME) {
ai->ai_canonname = strdup(by->realname);
if (ai->ai_canonname == NULL)
- ERR(EAI_MEMORY);
+ SETERROR(EAI_MEMORY);
}
addr = LWRES_LIST_NEXT(addr, link);
}
lwres = lwres_context_create(&lwrctx, NULL, NULL, NULL, 0);
if (lwres != LWRES_R_SUCCESS)
- ERR(EAI_FAIL);
+ SETERROR(EAI_FAIL);
(void) lwres_conf_parse(lwrctx, lwres_resolv_conf);
if (hostname == NULL && (flags & AI_PASSIVE) == 0) {
ai = ai_clone(*aip, AF_INET6);
if (ai == NULL) {
lwres_freeaddrinfo(*aip);
- ERR(EAI_MEMORY);
+ SETERROR(EAI_MEMORY);
}
*aip = ai;
if (lwres == LWRES_R_NOTFOUND)
goto cleanup;
else
- ERR(EAI_FAIL);
+ SETERROR(EAI_FAIL);
}
addr = LWRES_LIST_HEAD(by->addrs);
while (addr != NULL) {
ai = ai_clone(*aip, AF_INET6);
if (ai == NULL) {
lwres_freeaddrinfo(*aip);
- ERR(EAI_MEMORY);
+ SETERROR(EAI_MEMORY);
}
*aip = ai;
ai->ai_socktype = socktype;
if (flags & AI_CANONNAME) {
ai->ai_canonname = strdup(by->realname);
if (ai->ai_canonname == NULL)
- ERR(EAI_MEMORY);
+ SETERROR(EAI_MEMORY);
}
addr = LWRES_LIST_NEXT(addr, link);
}