diff options
author | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-10 19:53:18 +0000 |
---|---|---|
committer | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-10 19:53:18 +0000 |
commit | bfa2a19d965b4808ad264b35acd7b09d6d0fc90f (patch) | |
tree | f06f14f613f96ae25019ce97eb85bdc090725917 | |
parent | 76b40d554b37441373d1bcd9752556904d666c8e (diff) |
Slight tweak to setsockopt fix.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11824 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/socket.cpp | 4 | ||||
-rw-r--r-- | win/inspircd_win32wrapper.cpp | 5 | ||||
-rw-r--r-- | win/inspircd_win32wrapper.h | 3 |
3 files changed, 10 insertions, 2 deletions
diff --git a/src/socket.cpp b/src/socket.cpp index 0db7e1a6b..a4d1a7b79 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -97,8 +97,8 @@ int irc::sockets::OpenTCPSocket(const std::string& addr, int socktype) 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)); + 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)); diff --git a/win/inspircd_win32wrapper.cpp b/win/inspircd_win32wrapper.cpp index eb73378f2..d0ca50af8 100644 --- a/win/inspircd_win32wrapper.cpp +++ b/win/inspircd_win32wrapper.cpp @@ -91,6 +91,11 @@ 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 6b068adea..86a7baffe 100644 --- a/win/inspircd_win32wrapper.h +++ b/win/inspircd_win32wrapper.h @@ -132,6 +132,9 @@ 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 |