Skip to content

Commit

Permalink
Merge branch 'js/mingw-shutdown'
Browse files Browse the repository at this point in the history
* js/mingw-shutdown:
  Windows: add a wrapper for the shutdown() system call
  • Loading branch information
Junio C Hamano committed May 23, 2011
2 parents 3c0ae61 + a794179 commit c3c7797
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions compat/mingw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
3 changes: 3 additions & 0 deletions compat/mingw.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit c3c7797

Please sign in to comment.