Code

unix-socket: do not let close() or chdir() clobber errno during cleanup
[git.git] / compat / mingw.c
index 8947418ce78faa3619779c12319c0dd99b1557d3..efdc703257c9589018e59dc5bc93e9980e0f30b6 100644 (file)
@@ -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)
 {