Fixed ftp support with uClibc due to differing inet_ntoa_r() behaviour.

This commit is contained in:
Dan Fandrich 2005-03-15 21:00:46 +00:00
parent 9a5c21c16f
commit efaf688650
6 changed files with 32 additions and 14 deletions

View file

@ -65,10 +65,6 @@
#include <sys/sockio.h>
#endif
#if defined(HAVE_INET_NTOA_R) && !defined(HAVE_INET_NTOA_R_DECL)
#include "inet_ntoa_r.h"
#endif
#ifdef VMS
#include <inet.h>
#endif
@ -113,12 +109,7 @@ char *Curl_if2ip(const char *interface, char *buf, int buf_size)
struct sockaddr_in *s = (struct sockaddr_in *)&req.ifr_dstaddr;
memcpy(&in, &(s->sin_addr.s_addr), sizeof(in));
#if defined(HAVE_INET_NTOA_R)
ip = inet_ntoa_r(in,buf,buf_size);
#else
ip = strncpy(buf,inet_ntoa(in),buf_size);
ip[buf_size - 1] = 0;
#endif
ip = Curl_inet_ntop(s->sin_family, &in, buf, buf_size);
}
sclose(dummy);
}