summaryrefslogtreecommitdiff
path: root/src/socket.cpp
diff options
context:
space:
mode:
authorpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-10 19:32:34 +0000
committerpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-10 19:32:34 +0000
commit76b40d554b37441373d1bcd9752556904d666c8e (patch)
treea3424b7ba0363361a56ca4d10588d3cdfaef47b5 /src/socket.cpp
parent1312f2db8ed90464e73acdcc07bb1aae92964345 (diff)
Compile fixes for windows.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11823 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/socket.cpp')
-rw-r--r--src/socket.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/socket.cpp b/src/socket.cpp
index 74427d42a..0db7e1a6b 100644
--- a/src/socket.cpp
+++ b/src/socket.cpp
@@ -93,11 +93,16 @@ int irc::sockets::OpenTCPSocket(const std::string& addr, int socktype)
}
else
{
- setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &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
+ setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (char*)&on, sizeof(on));
+ setsockopt(sockfd, SOL_SOCKET, SO_LINGER, (char*)&linger, sizeof(linger));
+#elif
+ setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
setsockopt(sockfd, SOL_SOCKET, SO_LINGER, &linger, sizeof(linger));
+#endif
return (sockfd);
}
}