Skip to content
Permalink
Browse files

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 #1949.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information...
dscho committed Nov 23, 2018
1 parent 49587fd commit eca28c6e77c9e67414a2d1a825980dcc639cc873
Showing with 12 additions and 0 deletions.
  1. +8 −0 compat/mingw.c
  2. +4 −0 compat/mingw.h
@@ -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;
@@ -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

0 comments on commit eca28c6

Please sign in to comment.
You can’t perform that action at this time.