aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2022-09-19 19:02:40 -0400
committerRich Felker <dalias@aerifal.cx>2022-09-19 19:02:40 -0400
commitf081d5336a80b68d3e1bed789cc373c5c3d6699b (patch)
tree9ec8d0cd7d6bb8a48a636d4ca43071fb5875bcba
parent1e7fb12f775a3e599be08da9835422d96c56f479 (diff)
downloadmusl-f081d5336a80b68d3e1bed789cc373c5c3d6699b.tar.gz
musl-f081d5336a80b68d3e1bed789cc373c5c3d6699b.tar.xz
musl-f081d5336a80b68d3e1bed789cc373c5c3d6699b.zip
fix return value of gethostnbyname[2]_r on result not found
these functions are horribly underspecified, inconsistent between historical systems, and should never have been included. however, the signatures we have match the glibc ones, and the glibc behavior is to treat NxDomain and NODATA results as a success condition, not an ENOENT error.
-rw-r--r--src/network/gethostbyname2_r.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/gethostbyname2_r.c b/src/network/gethostbyname2_r.c
index fc894877..f012ec2f 100644
--- a/src/network/gethostbyname2_r.c
+++ b/src/network/gethostbyname2_r.c
@@ -22,7 +22,7 @@ int gethostbyname2_r(const char *name, int af,
if (cnt<0) switch (cnt) {
case EAI_NONAME:
*err = HOST_NOT_FOUND;
- return ENOENT;
+ return 0;
case EAI_AGAIN:
*err = TRY_AGAIN;
return EAGAIN;