summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2011-05-23 10:27:12 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-05-23 10:27:12 -0700
commitc3c7797e1d151417333296ab3720614c1e235094 (patch)
treefdd4ab37eaacafbabafef367aa0556efb249becc /compat
parentMerge branch 'ms/ls-remote-exit-with-status' (diff)
parentWindows: add a wrapper for the shutdown() system call (diff)
downloadtgif-c3c7797e1d151417333296ab3720614c1e235094.tar.xz
Merge branch 'js/mingw-shutdown'
* js/mingw-shutdown: Windows: add a wrapper for the shutdown() system call
Diffstat (limited to 'compat')
-rw-r--r--compat/mingw.c7
-rw-r--r--compat/mingw.h3
2 files changed, 10 insertions, 0 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index 4423961768..f6e9ff7762 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -1381,6 +1381,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)
{
diff --git a/compat/mingw.h b/compat/mingw.h
index 62eccd3391..547568b918 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -217,6 +217,9 @@ int mingw_bind(int sockfd, struct sockaddr *sa, size_t sz);
int mingw_setsockopt(int sockfd, int lvl, int optname, void *optval, int optlen);
#define setsockopt mingw_setsockopt
+int mingw_shutdown(int sockfd, int how);
+#define shutdown mingw_shutdown
+
int mingw_listen(int sockfd, int backlog);
#define listen mingw_listen