diff options
Diffstat (limited to 'src/nss-myhostname/nss-myhostname.c')
-rw-r--r-- | src/nss-myhostname/nss-myhostname.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/nss-myhostname/nss-myhostname.c b/src/nss-myhostname/nss-myhostname.c index baeb6f952d..5abc0c91bf 100644 --- a/src/nss-myhostname/nss-myhostname.c +++ b/src/nss-myhostname/nss-myhostname.c @@ -74,7 +74,7 @@ enum nss_status _nss_myhostname_gethostbyname4_r( } else { hn = gethostname_malloc(); if (!hn) { - *errnop = DISARM_PROTECT_ERRNO(ENOMEM); + *errnop = ENOMEM; *h_errnop = NO_RECOVERY; return NSS_STATUS_TRYAGAIN; } @@ -96,7 +96,7 @@ enum nss_status _nss_myhostname_gethostbyname4_r( l = strlen(canonical); ms = ALIGN(l+1) + ALIGN(sizeof(struct gaih_addrtuple)) * (n_addresses > 0 ? n_addresses : 2); if (buflen < ms) { - *errnop = DISARM_PROTECT_ERRNO(ERANGE); + *errnop = ERANGE; *h_errnop = NETDB_INTERNAL; return NSS_STATUS_TRYAGAIN; } @@ -171,7 +171,7 @@ static enum nss_status fill_in_hostent( uint32_t local_address_ipv4, struct hostent *result, char *buffer, size_t buflen, - int *errnop, int *h_errnop, int* _saved_errno_p, + int *errnop, int *h_errnop, int32_t *ttlp, char **canonp) { @@ -185,7 +185,6 @@ static enum nss_status fill_in_hostent( assert(buffer); assert(errnop); assert(h_errnop); - assert(_saved_errno_p); alen = FAMILY_ADDRESS_SIZE(af); @@ -203,7 +202,7 @@ static enum nss_status fill_in_hostent( (c > 0 ? c+1 : 2) * sizeof(char*); if (buflen < ms) { - *errnop = DISARM_PROTECT_ERRNO_INNER(ERANGE); + *errnop = ERANGE; *h_errnop = NETDB_INTERNAL; return NSS_STATUS_TRYAGAIN; } @@ -322,7 +321,7 @@ enum nss_status _nss_myhostname_gethostbyname3_r( af = AF_INET; if (!IN_SET(af, AF_INET, AF_INET6)) { - *errnop = DISARM_PROTECT_ERRNO(EAFNOSUPPORT); + *errnop = EAFNOSUPPORT; *h_errnop = NO_DATA; return NSS_STATUS_UNAVAIL; } @@ -344,7 +343,7 @@ enum nss_status _nss_myhostname_gethostbyname3_r( } else { hn = gethostname_malloc(); if (!hn) { - *errnop = DISARM_PROTECT_ERRNO(ENOMEM); + *errnop = ENOMEM; *h_errnop = NO_RECOVERY; return NSS_STATUS_TRYAGAIN; } @@ -370,7 +369,7 @@ enum nss_status _nss_myhostname_gethostbyname3_r( local_address_ipv4, host, buffer, buflen, - errnop, h_errnop, &_saved_errno_, + errnop, h_errnop, ttlp, canonp); } @@ -402,13 +401,13 @@ enum nss_status _nss_myhostname_gethostbyaddr2_r( assert(h_errnop); if (!IN_SET(af, AF_INET, AF_INET6)) { - *errnop = DISARM_PROTECT_ERRNO(EAFNOSUPPORT); + *errnop = EAFNOSUPPORT; *h_errnop = NO_DATA; return NSS_STATUS_UNAVAIL; } if (len != FAMILY_ADDRESS_SIZE(af)) { - *errnop = DISARM_PROTECT_ERRNO(EINVAL); + *errnop = EINVAL; *h_errnop = NO_RECOVERY; return NSS_STATUS_UNAVAIL; } @@ -462,7 +461,7 @@ found: if (!canonical || additional_from_hostname) { hn = gethostname_malloc(); if (!hn) { - *errnop = DISARM_PROTECT_ERRNO(ENOMEM); + *errnop = ENOMEM; *h_errnop = NO_RECOVERY; return NSS_STATUS_TRYAGAIN; } @@ -480,7 +479,7 @@ found: local_address_ipv4, host, buffer, buflen, - errnop, h_errnop, &_saved_errno_, + errnop, h_errnop, ttlp, NULL); } |