Skip to content

Commit c3c7797

Browse files
committed
Merge branch 'js/mingw-shutdown'
* js/mingw-shutdown: Windows: add a wrapper for the shutdown() system call
2 parents 3c0ae61 + a794179 commit c3c7797

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

compat/mingw.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,6 +1381,13 @@ int mingw_setsockopt(int sockfd, int lvl, int optname, void *optval, int optlen)
13811381
return setsockopt(s, lvl, optname, (const char*)optval, optlen);
13821382
}
13831383

1384+
#undef shutdown
1385+
int mingw_shutdown(int sockfd, int how)
1386+
{
1387+
SOCKET s = (SOCKET)_get_osfhandle(sockfd);
1388+
return shutdown(s, how);
1389+
}
1390+
13841391
#undef listen
13851392
int mingw_listen(int sockfd, int backlog)
13861393
{

compat/mingw.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ int mingw_bind(int sockfd, struct sockaddr *sa, size_t sz);
217217
int mingw_setsockopt(int sockfd, int lvl, int optname, void *optval, int optlen);
218218
#define setsockopt mingw_setsockopt
219219

220+
int mingw_shutdown(int sockfd, int how);
221+
#define shutdown mingw_shutdown
222+
220223
int mingw_listen(int sockfd, int backlog);
221224
#define listen mingw_listen
222225

0 commit comments

Comments
 (0)