EAI_SYSTEM and ECANCELED are undefined under cygwin; added
conditional #define.
This commit is contained in:
parent
c53ffd5314
commit
e9ecb1b8b0
|
@ -27,6 +27,10 @@ typedef struct errno_info {
|
||||||
ikptr c;
|
ikptr c;
|
||||||
} errno_info;
|
} errno_info;
|
||||||
|
|
||||||
|
#ifndef ECANCELED
|
||||||
|
#define ECANCELED 140
|
||||||
|
#endif
|
||||||
|
|
||||||
static errno_info errno_table[] = {
|
static errno_info errno_table[] = {
|
||||||
/* errnos from POSIX IEEE Std 1003.1 2004 Edition */
|
/* errnos from POSIX IEEE Std 1003.1 2004 Edition */
|
||||||
{E2BIG, "E2BIG", fix(-1)},
|
{E2BIG, "E2BIG", fix(-1)},
|
||||||
|
|
|
@ -33,7 +33,7 @@ getaddrinfo(const char *hostname, const char* servname,
|
||||||
const struct addrinfo* hints, struct addrinfo** res){
|
const struct addrinfo* hints, struct addrinfo** res){
|
||||||
/* hints not used */
|
/* hints not used */
|
||||||
struct servent* sent = getservbyname(servname, "tcp");
|
struct servent* sent = getservbyname(servname, "tcp");
|
||||||
if(sent == 0) return -1;
|
if (sent == 0) return -1;
|
||||||
struct hostent* hent = gethostbyname(hostname);
|
struct hostent* hent = gethostbyname(hostname);
|
||||||
if (!hent){
|
if (!hent){
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -57,7 +57,7 @@ getaddrinfo(const char *hostname, const char* servname,
|
||||||
memcpy(&sa_in->sin_addr, *ap, sizeof(struct in_addr));
|
memcpy(&sa_in->sin_addr, *ap, sizeof(struct in_addr));
|
||||||
r->ai_next = NULL;
|
r->ai_next = NULL;
|
||||||
*res = r;
|
*res = r;
|
||||||
return (0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -40,5 +40,10 @@ getaddrinfo(const char *hostname, const char* servname,
|
||||||
extern void
|
extern void
|
||||||
freeaddrinfo(struct addrinfo *ai);
|
freeaddrinfo(struct addrinfo *ai);
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef EAI_SYSTEM
|
||||||
|
# define EAI_SYSTEM 11 /* same code as in glibc */
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue