mingw: ensure sockets are initialized before calling gethostname
commite59f1619d0eb9ed2d3c54b8fb83518c71e9f32b4
authorPat Thoyts <patthoyts@users.sourceforge.net>
Fri, 14 Oct 2011 08:56:16 +0000 (14 09:56 +0100)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Fri, 14 Oct 2011 08:56:16 +0000 (14 09:56 +0100)
treeda3c6d1069413946a56ffb00b9cc8203183bfd65
parent7e4bf67e6a51c7200407017c69b4a67687fe609e
mingw: ensure sockets are initialized before calling gethostname

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>
compat/mingw.c
compat/mingw.h