Verified Commit 1b235305 authored by A. Wilcox's avatar A. Wilcox 🦊
Browse files

__lookup_serv: return correct error code

If AI_NUMERICSERV is specified and a numeric service was not provided,
POSIX mandates getaddrinfo return EAI_NONAME.  EAI_SERVICE is only for
services that cannot be used on the specified socket type.
parent c10bc615
......@@ -64,7 +64,7 @@ int __lookup_serv(struct service buf[static MAXSERVS], const char *name, int pro
return cnt;
}
if (flags & AI_NUMERICSERV) return EAI_SERVICE;
if (flags & AI_NUMERICSERV) return EAI_NONAME;
size_t l = strlen(name);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment