remove impossible error case from gethostbyname2_r
authorRich Felker <dalias@aerifal.cx>
Mon, 19 Sep 2022 23:09:02 +0000 (19:09 -0400)
committerRich Felker <dalias@aerifal.cx>
Mon, 19 Sep 2022 23:09:02 +0000 (19:09 -0400)
EAI_MEMORY is not possible because the resolver backend does not
allocate. if it did, it would be necessary for us to explicitly return
ENOMEM as the error, since errno is not guaranteed to reflect the
error cause except in the case of EAI_SYSTEM, so the existing code was
not correct anyway.

src/network/gethostbyname2_r.c

index f012ec2..c9f3acc 100644 (file)
@@ -30,7 +30,6 @@ int gethostbyname2_r(const char *name, int af,
        case EAI_FAIL:
                *err = NO_RECOVERY;
                return EBADMSG;
-       case EAI_MEMORY:
        case EAI_SYSTEM:
                *err = NO_RECOVERY;
                return errno;