summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4fec830)
raw | patch | inline | side by side (parent: 4fec830)
author | Johannes Sixt <j6t@kdbg.org> | |
Wed, 18 May 2011 20:24:37 +0000 (22:24 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 18 May 2011 21:24:48 +0000 (14:24 -0700) |
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>
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>
compat/mingw.c | patch | blob | history | |
compat/mingw.h | patch | blob | history |
diff --git a/compat/mingw.c b/compat/mingw.c
index bee605441910caeddd1e94eb7795f615a3d1348a..1cbc9e83d460804e4cafd2c76025ad0d42d81a3e 100644 (file)
--- 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)
{
diff --git a/compat/mingw.h b/compat/mingw.h
index 14211c6214ea4654e0bb9dd25b29d7b28ac6141d..3b20fa979935411232d2ee986845079641e53ac6 100644 (file)
--- a/compat/mingw.h
+++ b/compat/mingw.h
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