Skip to content

Commit eca28c6

Browse files
committed
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 <[email protected]>
1 parent 49587fd commit eca28c6

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

compat/mingw.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2143,6 +2143,14 @@ struct hostent *mingw_gethostbyname(const char *host)
21432143
return gethostbyname(host);
21442144
}
21452145

2146+
#undef getaddrinfo
2147+
int mingw_getaddrinfo(const char *node, const char *service,
2148+
const struct addrinfo *hints, struct addrinfo **res)
2149+
{
2150+
ensure_socket_initialization();
2151+
return getaddrinfo(node, service, hints, res);
2152+
}
2153+
21462154
int mingw_socket(int domain, int type, int protocol)
21472155
{
21482156
int sockfd;

compat/mingw.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,10 @@ int mingw_gethostname(char *host, int namelen);
297297
struct hostent *mingw_gethostbyname(const char *host);
298298
#define gethostbyname mingw_gethostbyname
299299

300+
int mingw_getaddrinfo(const char *node, const char *service,
301+
const struct addrinfo *hints, struct addrinfo **res);
302+
#define getaddrinfo mingw_getaddrinfo
303+
300304
int mingw_socket(int domain, int type, int protocol);
301305
#define socket mingw_socket
302306

0 commit comments

Comments
 (0)