Skip to content

Commit

Permalink
Fix Windows build error
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbrechtL committed Oct 19, 2019
1 parent 1711a0c commit 761d19e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/various/Socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ bool Socket::bind(int port)
const int bind_ret = ::bind(listensock, (sockaddr*)&addr, sizeof(sockaddr_in));
if (bind_ret == -1) {
perror("Could not bind socket");
#if defined(_WIN32)
closesocket(listensock);
#else
::close(listensock);
#endif
return false;
}

Expand Down

0 comments on commit 761d19e

Please sign in to comment.