Support gethostbyname_r_ERANGE.
[android-sdk/platform-bionic.git] / libc / dns / gethnamaddr.c
index 63a6a60d3e218f4f7d6bbe1ba5cac7cd6844a302..8f5800a434460f70a0d14965eb6b371c16613eb9 100644 (file)
@@ -1208,7 +1208,7 @@ _dns_gethtbyname(void *rv, void *cb_data, va_list ap)
        free(buf);
        __res_put_state(res);
        if (hp == NULL)
-               switch (h_errno) {
+               switch (*info->he) {
                case HOST_NOT_FOUND:
                        return NS_NOTFOUND;
                case TRY_AGAIN:
@@ -1326,6 +1326,7 @@ _dns_gethtbyaddr(void *rv, void   *cb_data, va_list ap)
        *info->he = NETDB_SUCCESS;
        return NS_SUCCESS;
 nospc:
+       errno = ENOSPC;
        *info->he = NETDB_INTERNAL;
        return NS_UNAVAIL;
 }