提交 30fdda6c 编写于 作者: A A. Wilcox 提交者: Rich Felker

fix getaddrinfo error code for non-numeric service with AI_NUMERICSERV

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.
上级 67b29947
......@@ -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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册