summaryrefslogtreecommitdiff
path: root/src/inspsocket.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-07-03 17:26:45 -0400
committerattilamolnar <attilamolnar@hush.com>2013-07-14 20:23:53 +0200
commit6e0b904d342461cd2ac2a3cd0cf2a43d864d2b00 (patch)
tree980eb8923398714aeef820d0bb6b719f3b149837 /src/inspsocket.cpp
parent2a9aa9be8ac4a97ce766c797aff76abf135bb139 (diff)
Use the correct socket related error messages on Windows
Diffstat (limited to 'src/inspsocket.cpp')
-rw-r--r--src/inspsocket.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp
index 410f928d9..356904f74 100644
--- a/src/inspsocket.cpp
+++ b/src/inspsocket.cpp
@@ -56,7 +56,7 @@ void BufferedSocket::DoConnect(const std::string &ipaddr, int aport, unsigned lo
if (err != I_ERR_NONE)
{
state = I_ERROR;
- SetError(strerror(errno));
+ SetError(SocketEngine::LastError());
OnError(err);
}
}
@@ -210,7 +210,7 @@ void StreamSocket::DoRead()
}
else
{
- error = strerror(errno);
+ error = SocketEngine::LastError();
ServerInstance->SE->ChangeEventMask(this, FD_WANT_NO_READ | FD_WANT_NO_WRITE);
}
}
@@ -296,7 +296,7 @@ void StreamSocket::DoWrite()
if (errno == EINTR || SocketEngine::IgnoreError())
ServerInstance->SE->ChangeEventMask(this, FD_WANT_FAST_WRITE | FD_WRITE_WILL_BLOCK);
else
- SetError(strerror(errno));
+ SetError(SocketEngine::LastError());
return;
}
else if (rv < itemlen)
@@ -401,7 +401,7 @@ void StreamSocket::DoWrite()
}
else
{
- error = strerror(errno);
+ error = SocketEngine::LastError();
}
}
if (!error.empty())
@@ -496,7 +496,7 @@ void StreamSocket::HandleEvent(EventType et, int errornum)
if (errornum == 0)
SetError("Connection closed");
else
- SetError(strerror(errornum));
+ SetError(SocketEngine::GetError(errornum));
switch (errornum)
{
case ETIMEDOUT: