fixup! mingw: remove obsolete IPv6-related code

We still need to ensure that sockets are initialized when calling
`getaddrinfo()`, otherwise git:// URLs cannot be accessed.

This fixes https://github.com/git-for-windows/git/issues/1949.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2018-11-23 13:17:24 +01:00
parent 1e09c692b2
commit d5c42d70de
2 changed files with 12 additions and 0 deletions

View File

@@ -2143,6 +2143,14 @@ struct hostent *mingw_gethostbyname(const char *host)
return gethostbyname(host);
}
#undef getaddrinfo
int mingw_getaddrinfo(const char *node, const char *service,
const struct addrinfo *hints, struct addrinfo **res)
{
ensure_socket_initialization();
return getaddrinfo(node, service, hints, res);
}
int mingw_socket(int domain, int type, int protocol)
{
int sockfd;

View File

@@ -297,6 +297,10 @@ int mingw_gethostname(char *host, int namelen);
struct hostent *mingw_gethostbyname(const char *host);
#define gethostbyname mingw_gethostbyname
int mingw_getaddrinfo(const char *node, const char *service,
const struct addrinfo *hints, struct addrinfo **res);
#define getaddrinfo mingw_getaddrinfo
int mingw_socket(int domain, int type, int protocol);
#define socket mingw_socket