Skip to content

Commit

Permalink
fixup! mingw: remove obsolete IPv6-related code
Browse files Browse the repository at this point in the history
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 eca28c6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions compat/mingw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions compat/mingw.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit eca28c6

Please sign in to comment.