mirror of
https://github.com/curl/curl.git
synced 2026-07-29 00:03:12 +03:00
Fixed ftp support with uClibc due to differing inet_ntoa_r() behaviour.
This commit is contained in:
parent
9a5c21c16f
commit
efaf688650
6 changed files with 32 additions and 14 deletions
11
lib/if2ip.c
11
lib/if2ip.c
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue