AIX: cast for hstrerror()

This commit is contained in:
Gerhard Rieger 2008-10-12 18:56:01 +02:00
parent 01f990310e
commit bc4fefdc50
4 changed files with 15 additions and 8 deletions

View File

@ -98,8 +98,11 @@ corrections:
feature (thanks to Pavan Gadi for reporting this bug)
porting:
socat should now build under MacOS X 10.4 (thanks to Camillo Lugaresi for
providing the patch)
socat should now build under MacOS X 10.4 (thanks to Camillo Lugaresi
for providing the patch)
socat compiles and runs on AIX (thanks to Andi Mather for testing and
patching)
further changes:
filan -s prefixes output with FD number if more than one FD

4
README
View File

@ -45,11 +45,11 @@ distributions.
platforms
---------
socat 1.6.0 was compiled and more or less successfully tested under the
socat 1.7.0 was compiled and more or less successfully tested under the
following operating systems:
SuSE Linux 10.1 on x86
AIX 5.2 on PPC with gcc
AIX 5.3 on PPC with gcc
Solaris 9 on Sparc with gcc
FreeBSD 6.1 on x86
HP-UX B 11.11 on PA-RISC with gcc

View File

@ -32,9 +32,10 @@ int xioparsenetwork_ip4(const char *rangename, struct xiorange *range) {
netmask_in->s_addr = htonl((0xffffffff << (32-bits)));
} else if (delimpos = strchr(rangename1, ':')) {
if ((maskaddr = Gethostbyname(delimpos+1)) == NULL) {
/* note: cast is req on AIX: */
Error2("gethostbyname(\"%s\"): %s", delimpos+1,
h_errno == NETDB_INTERNAL ? strerror(errno) :
hstrerror(h_errno));
(char *)hstrerror(h_errno));
return STAT_NORETRY;
}
netmask_in->s_addr = *(uint32_t *)maskaddr->h_addr_list[0];
@ -47,9 +48,10 @@ int xioparsenetwork_ip4(const char *rangename, struct xiorange *range) {
struct hostent *nameaddr;
*delimpos = 0;
if ((nameaddr = Gethostbyname(rangename1)) == NULL) {
/* note: cast is req on AIX: */
Error2("gethostbyname(\"%s\"): %s", rangename1,
h_errno == NETDB_INTERNAL ? strerror(errno) :
hstrerror(h_errno));
(char *)hstrerror(h_errno));
free(rangename1);
return STAT_NORETRY;
}

View File

@ -244,9 +244,11 @@ int _xioopen_proxy_prepare(struct proxyvars *proxyvars, struct opt *opts,
host = Gethostbyname(targetname);
if (host == NULL) {
int level = E_WARN;
/* note: cast is req on AIX: */
Msg2(level, "gethostbyname(\"%s\"): %s", targetname,
h_errno == NETDB_INTERNAL ? strerror(errno) :
hstrerror(h_errno)/*0 h_messages[h_errno-1]*/);
h_errno == NETDB_INTERNAL ? strerror(errno) :
(char *)hstrerror(h_errno)/*0 h_messages[h_errno-1]*/);
proxyvars->targetaddr = strdup(targetname);
} else {
#define LEN 16 /* www.xxx.yyy.zzz\0 */