fd_util: add function close_socket()

Wrap close(), use closesocket() on WIN32/WinSock.
This commit is contained in:
Max Kellermann
2011-09-19 21:04:19 +02:00
parent 77a56c7c5a
commit c476819cb1
7 changed files with 26 additions and 8 deletions

View File

@@ -304,3 +304,13 @@ inotify_init_cloexec(void)
}
#endif
int
close_socket(int fd)
{
#ifdef WIN32
return closesocket(fd);
#else
return close(fd);
#endif
}