fd_util: add function close_socket()
Wrap close(), use closesocket() on WIN32/WinSock.
This commit is contained in:
@@ -304,3 +304,13 @@ inotify_init_cloexec(void)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
int
|
||||
close_socket(int fd)
|
||||
{
|
||||
#ifdef WIN32
|
||||
return closesocket(fd);
|
||||
#else
|
||||
return close(fd);
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user