summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8850c3d)
raw | patch | inline | side by side (parent: 8850c3d)
author | Pat Thoyts <patthoyts@users.sourceforge.net> | |
Sat, 15 Oct 2011 14:05:20 +0000 (15:05 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 16 Oct 2011 03:14:39 +0000 (20:14 -0700) |
If the Windows sockets subsystem has not been initialized yet then an
attempt to get the hostname returns an error and prints a warning to the
console. This solves this issue for msysGit as seen with 'git fetch'.
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
attempt to get the hostname returns an error and prints a warning to the
console. This solves this issue for msysGit as seen with 'git fetch'.
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/mingw.c | patch | blob | history | |
compat/mingw.h | patch | blob | history |
diff --git a/compat/mingw.c b/compat/mingw.c
index 6ef0cc4f99becd772a6fed1cfe2484a67b3a9000..8e17daeac3dee79cedf0aeed73527d16f27e4527 100644 (file)
--- a/compat/mingw.c
+++ b/compat/mingw.c
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)
{
diff --git a/compat/mingw.h b/compat/mingw.h
index ce9dd980eb211c0301c4008249c61fb0b09f1280..fecf0d07760d2211fac6db2e19ecbedaac81c57e 100644 (file)
--- a/compat/mingw.h
+++ b/compat/mingw.h
char *mingw_getenv(const char *name);
#define getenv mingw_getenv
+int mingw_gethostname(char *host, int namelen);
+#define gethostname mingw_gethostname
+
struct hostent *mingw_gethostbyname(const char *host);
#define gethostbyname mingw_gethostbyname