diff options
author | Wayne Davison <wayned@samba.org> | 2007-11-08 14:54:58 +0000 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2007-11-08 14:54:58 +0000 |
commit | 9456434688a271d2842431530108d7a13df96aac (patch) | |
tree | 834e7ca0d784a0cf378f4525a81fe76a41e0c397 /lib | |
parent | 268da8167a4d25130f2f9c6cc49c8c31362df5e9 (diff) | |
download | rsync-9456434688a271d2842431530108d7a13df96aac.tar.gz rsync-9456434688a271d2842431530108d7a13df96aac.tar.bz2 rsync-9456434688a271d2842431530108d7a13df96aac.zip |
Some fixes for SCO in new getaddrinfo() code.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/getaddrinfo.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/getaddrinfo.c b/lib/getaddrinfo.c index a919ff63..838e7086 100644 --- a/lib/getaddrinfo.c +++ b/lib/getaddrinfo.c @@ -53,8 +53,15 @@ TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. #define SMB_STRDUP(s) strdup(s) #endif +#ifndef HOST_NAME_MAX +#define HOST_NAME_MAX 255 +#endif + static int check_hostent_err(struct hostent *hp) { +#ifndef INET6 + extern int h_errno; +#endif if (!hp) { switch (h_errno) { case HOST_NOT_FOUND: @@ -399,8 +406,8 @@ static int gethostnameinfo(const struct sockaddr *sa, if (!(flags & NI_NUMERICHOST)) { struct hostent *hp = gethostbyaddr( - &((struct sockaddr_in *)sa)->sin_addr, - sizeof(struct in_addr), + (void *)&((struct sockaddr_in *)sa)->sin_addr, + sizeof (struct in_addr), sa->sa_family); ret = check_hostent_err(hp); if (ret == 0) { @@ -481,7 +488,7 @@ int getnameinfo(const struct sockaddr *sa, socklen_t salen, return EAI_FAIL; } - if (salen < sizeof(struct sockaddr_in)) { + if (salen < (socklen_t)sizeof (struct sockaddr_in)) { return EAI_FAIL; } |