summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-03-25 17:57:55 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-03-25 17:57:55 +0000
commitc6e3bd2b5729ec660870022d2f08124f2bddee41 (patch)
tree00df1fdaff6d944bc8535f1c2587abe9d4e2fa81
parent3debc17c519d42cb0c0e7154cdd9704eddd15fcc (diff)
Fix some win32 compile errors, thanks for error output therock247uk
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11263 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/threadengines/threadengine_win32.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/threadengines/threadengine_win32.cpp b/src/threadengines/threadengine_win32.cpp
index a20251348..449530e46 100644
--- a/src/threadengines/threadengine_win32.cpp
+++ b/src/threadengines/threadengine_win32.cpp
@@ -53,9 +53,9 @@ void ThreadData::FreeThread(Thread* thread)
class ThreadSignalSocket : public BufferedSocket
{
- SignalThread* parent;
+ SocketThread* parent;
public:
- ThreadSignalSocket(SignalThread* t, InspIRCd* SI, int newfd, char* ip)
+ ThreadSignalSocket(SocketThread* t, InspIRCd* SI, int newfd, char* ip)
: BufferedSocket(SI, newfd, ip), parent(t)
{
parent->results = this;
@@ -113,12 +113,12 @@ SocketThread::SocketThread(InspIRCd* SI)
if (connFD == -1)
throw CoreException("Could not create ITC pipe");
- irc::sockets::sockaddrs addr;
- irc::sockets::insp_aton("127.0.0.1", &addr.in4.sin_addr);
- addr.in4.sin_family = AF_INET;
- addr.in4.sin_port = htons(listener->GetPort());
+ struct sockaddr_in addr;
+ irc::sockets::insp_aton("127.0.0.1", &addr.sin_addr);
+ addr.sin_family = AF_INET;
+ addr.sin_port = htons(listener->GetPort());
- if (connect(connFD, &addr.sa, sizeof(addr.in4)) == -1)
+ if (connect(connFD, static_cast<struct sockaddr*>(&addr), sizeof(addr)) == -1)
{
ServerInstance->SE->DelFd(listener);
close(connFD);
@@ -135,5 +135,9 @@ void SocketThread::NotifyParent()
SocketThread::~SocketThread()
{
- close(signal.connFD);
+ if (signal.connFD >= 0)
+ {
+ shutdown(signal.connFD, 2);
+ close(signal.connFD);
+ }
}