diff options
Diffstat (limited to 'compat/mingw.c')
-rw-r--r-- | compat/mingw.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/compat/mingw.c b/compat/mingw.c index 6ef0cc4f99..a0ac487c0c 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -1183,7 +1183,7 @@ static int WSAAPI getaddrinfo_stub(const char *node, const char *service, } ai->ai_addrlen = sizeof(struct sockaddr_in); if (hints && (hints->ai_flags & AI_CANONNAME)) - ai->ai_canonname = h ? strdup(h->h_name) : NULL; + ai->ai_canonname = h ? xstrdup(h->h_name) : NULL; else ai->ai_canonname = NULL; @@ -1321,6 +1321,13 @@ static void ensure_socket_initialization(void) initialized = 1; } +#undef gethostname +int mingw_gethostname(char *name, int namelen) +{ + ensure_socket_initialization(); + return gethostname(name, namelen); +} + #undef gethostbyname struct hostent *mingw_gethostbyname(const char *host) { @@ -1705,7 +1712,7 @@ char *getpass(const char *prompt) return strbuf_detach(&buf, NULL); } -pid_t waitpid(pid_t pid, int *status, unsigned options) +pid_t waitpid(pid_t pid, int *status, int options) { HANDLE h = OpenProcess(SYNCHRONIZE | PROCESS_QUERY_INFORMATION, FALSE, pid); |