Commit 6606efa8 authored by rbultje's avatar rbultje

Implement gai_strerror() for systems lacking such functionality. Patch

by KO Myung-Hung <komh challion net>.



git-svn-id: file:///var/local/repositories/ffmpeg/trunk@21692 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 9ef6b0a3
......@@ -147,9 +147,11 @@ void ff_freeaddrinfo(struct addrinfo *res);
int ff_getnameinfo(const struct sockaddr *sa, int salen,
char *host, int hostlen,
char *serv, int servlen, int flags);
const char *ff_gai_strerror(int ecode);
#define getaddrinfo ff_getaddrinfo
#define freeaddrinfo ff_freeaddrinfo
#define getnameinfo ff_getnameinfo
#define gai_strerror ff_gai_strerror
#endif
#endif /* AVFORMAT_NETWORK_H */
......@@ -203,6 +203,17 @@ int ff_getnameinfo(const struct sockaddr *sa, int salen,
return 0;
}
const char *ff_gai_strerror(int ecode)
{
switch(ecode) {
case EAI_FAIL : return "A non-recoverable error occurred";
case EAI_FAMILY : return "The address family was not recognized or the address length was invalid for the specified family";
case EAI_NONAME : return "The name does not resolve for the supplied parameters";
}
return "Unknown error";
}
#endif
/* resolve host with also IP address parsing */
......
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