diff options
author | Daniel Stenberg <daniel@haxx.se> | 2000-05-30 22:27:39 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2000-05-30 22:27:39 +0000 |
commit | 8d76ad6c8e235bf4f558b1c250886b0085ecd1fe (patch) | |
tree | ea059d8b9e82957155b26f2ca4b3ea899055c23d /lib/ftp.c | |
parent | 784c29c6c5fb53edb0c33b65d6a20902eaa7ef53 (diff) |
Adjusted to the GETHOSTBYADDR_R_NARGS style
Diffstat (limited to 'lib/ftp.c')
-rw-r--r-- | lib/ftp.c | 24 |
1 files changed, 19 insertions, 5 deletions
@@ -692,20 +692,34 @@ CURLcode _ftp(struct connectdata *conn) #if defined(HAVE_INET_ADDR) unsigned long address; -#if defined(HAVE_GETHOSTBYADDR_R) +# if defined(HAVE_GETHOSTBYADDR_R) int h_errnop; -#endif +# endif address = inet_addr(newhost); -#if defined(HAVE_GETHOSTBYADDR_R) +# if defined(HAVE_GETHOSTBYADDR_R) + +# if (GETHOSTBYADDR_R_NARGS < 8) + /* Solaris and IRIX */ answer = gethostbyaddr_r((char *) &address, sizeof(address), AF_INET, (struct hostent *)hostent_buf, hostent_buf + sizeof(*answer), sizeof(hostent_buf) - sizeof(*answer), &h_errnop); -#else +# else + /* Linux style */ + if(gethostbyaddr_r((char *) &address, sizeof(address), AF_INET, + (struct hostent *)hostent_buf, + hostent_buf + sizeof(*answer), + sizeof(hostent_buf) - sizeof(*answer), + &answer, + &h_errnop)) + answer=NULL; /* error */ +# endif + +# else answer = gethostbyaddr((char *) &address, sizeof(address), AF_INET); -#endif +# endif #else answer = NULL; #endif |