Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2011-05-19 00:24:37 +0400
committerJunio C Hamano <gitster@pobox.com>2011-05-19 01:24:48 +0400
commita7941795b1eb720f3bf3df2f4c68d58dd0fba7e1 (patch)
tree48c07a875001d61d5904e6e16804e1309b036f1d /compat/mingw.c
parent4fec83045bdc53ed9d3ff71ed099e3e6992b5c56 (diff)
Windows: add a wrapper for the shutdown() system call
Even though Windows's socket functions look like their POSIX counter parts, they do not operate on file descriptors, but on "socket objects". To bring the functions in line with POSIX, we have proxy functions that wrap and unwrap the socket objects in file descriptors using open_osfhandle and get_osfhandle. But shutdown() was not proxied, yet. Fix this. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat/mingw.c')
-rw-r--r--compat/mingw.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index bee6054419..1cbc9e83d4 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -1219,6 +1219,13 @@ int mingw_setsockopt(int sockfd, int lvl, int optname, void *optval, int optlen)
return setsockopt(s, lvl, optname, (const char*)optval, optlen);
}
+#undef shutdown
+int mingw_shutdown(int sockfd, int how)
+{
+ SOCKET s = (SOCKET)_get_osfhandle(sockfd);
+ return shutdown(s, how);
+}
+
#undef listen
int mingw_listen(int sockfd, int backlog)
{