summaryrefslogtreecommitdiff
path: root/src/socketengines
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-09-17 19:20:07 -0400
committerAdam <Adam@anope.org>2010-09-17 19:20:07 -0400
commit227909e2cf0039737dc52872651837fe5f1702b5 (patch)
treeb8a7072c7d938ea66d9710a48d717b3eb76343de /src/socketengines
parentf71fb6e8133da955a58b1cca00013ce20c0b65cc (diff)
Rejig of some of the socket stuff. Fixed marking sockets as nonblocking on Windows. Added in a LastError function to keep having to use strerror/GetLastError everywhere.
Diffstat (limited to 'src/socketengines')
-rw-r--r--src/socketengines/socketengine_eventfd.cpp2
-rw-r--r--src/socketengines/socketengine_pipe.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/socketengines/socketengine_eventfd.cpp b/src/socketengines/socketengine_eventfd.cpp
index 767a6eddb..a0efe5286 100644
--- a/src/socketengines/socketengine_eventfd.cpp
+++ b/src/socketengines/socketengine_eventfd.cpp
@@ -16,7 +16,7 @@ Pipe::Pipe() : Socket()
{
this->Sock = eventfd(0, EFD_NONBLOCK);
if (this->Sock < 0)
- throw CoreException(Anope::string("Could not create pipe: ") + strerror(errno));
+ throw CoreException(Anope::string("Could not create pipe: ") + Anope::LastError());
this->IPv6 = false;
this->Type = SOCKTYPE_CLIENT;
diff --git a/src/socketengines/socketengine_pipe.cpp b/src/socketengines/socketengine_pipe.cpp
index 0b319f0b0..b0be664c8 100644
--- a/src/socketengines/socketengine_pipe.cpp
+++ b/src/socketengines/socketengine_pipe.cpp
@@ -17,7 +17,7 @@ Pipe::Pipe() : Socket()
{
int fds[2];
if (pipe(fds))
- throw CoreException(Anope::string("Could not create pipe: ") + strerror(errno));
+ throw CoreException(Anope::string("Could not create pipe: ") + Anope::LastError());
int flags = fcntl(fds[0], F_GETFL, 0);
fcntl(fds[0], F_SETFL, flags | O_NONBLOCK);
flags = fcntl(fds[1], F_GETFL, 0);