From 64904b639d154394fa8138a7c8c0d5ff17e14718 Mon Sep 17 00:00:00 2001 From: peavey Date: Sat, 10 Oct 2009 19:59:04 +0000 Subject: 3rd time lucky? Fix again for setsockopt. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11825 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/socket.cpp | 9 ++------- win/inspircd_win32wrapper.cpp | 5 ----- win/inspircd_win32wrapper.h | 3 --- 3 files changed, 2 insertions(+), 15 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); } } diff --git a/win/inspircd_win32wrapper.cpp b/win/inspircd_win32wrapper.cpp index d0ca50af8..eb73378f2 100644 --- a/win/inspircd_win32wrapper.cpp +++ b/win/inspircd_win32wrapper.cpp @@ -91,11 +91,6 @@ int insp_inet_pton(int af, const char *src, void *dst) return rv; } -int insp_setsockopt(int sockfd, int level, int optname, void *optval, int optlen) -{ - return setsockopt(sockfd, level, optname, (char*)optval, optlen); -} - void setcolor(int color_code) { SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color_code); diff --git a/win/inspircd_win32wrapper.h b/win/inspircd_win32wrapper.h index 86a7baffe..6b068adea 100644 --- a/win/inspircd_win32wrapper.h +++ b/win/inspircd_win32wrapper.h @@ -132,9 +132,6 @@ CoreExport const char * insp_inet_ntop(int af, const void * src, char * dst, soc #define inet_pton insp_inet_pton #define inet_ntop insp_inet_ntop -/* slightly different format on setsockopt */ -CoreExport int insp_setsockopt(int sockfd, int level, int optname, void *optval, int optlen); - /* Safe printf functions aren't defined in VC2003 */ #define snprintf _snprintf #define vsnprintf _vsnprintf -- cgit v1.2.3