diff options
author | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-10 19:59:04 +0000 |
---|---|---|
committer | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-10 19:59:04 +0000 |
commit | 64904b639d154394fa8138a7c8c0d5ff17e14718 (patch) | |
tree | 327f35781a6fff29cf56d641b7f6fc3de2af8dd5 /src/socket.cpp | |
parent | bfa2a19d965b4808ad264b35acd7b09d6d0fc90f (diff) |
3rd time lucky? Fix again for setsockopt.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11825 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/socket.cpp')
-rw-r--r-- | src/socket.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/socket.cpp b/src/socket.cpp index a4d1a7b79..efe799bfc 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -93,16 +93,11 @@ int irc::sockets::OpenTCPSocket(const std::string& addr, int socktype) } else { + setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (char*)&on, sizeof(on)); /* This is BSD compatible, setting l_onoff to 0 is *NOT* http://web.irc.org/mla/ircd-dev/msg02259.html */ linger.l_onoff = 1; linger.l_linger = 1; -#ifdef WINDOWS - insp_setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); - insp_setsockopt(sockfd, SOL_SOCKET, SO_LINGER, &linger, sizeof(linger)); -#elif - setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); - setsockopt(sockfd, SOL_SOCKET, SO_LINGER, &linger, sizeof(linger)); -#endif + setsockopt(sockfd, SOL_SOCKET, SO_LINGER, (char*)&linger, sizeof(linger)); return (sockfd); } } |