summaryrefslogtreecommitdiff
path: root/src/Socket.cc
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2011-10-18 09:35:45 -0700
committerPixel <pixel@nobis-crew.org>2011-10-18 09:35:45 -0700
commite0add8d5cb4fdb408efda292f64e029aa7ebbad2 (patch)
treef256b90f2cf03dba7f00ecac07500ad85064d8d4 /src/Socket.cc
parent56837535aeb1c7ae0fa2730d77dd718c334cf729 (diff)
Fixing Darwin compilation:
-) Using clang instead of gcc for the native target (*sigh*) -) Fixing libeio (*sigh*) -) "Fixing" the connect() call in Sockets because Darwin is stupid (*SIIIIIIIGH*) Although the Threads unit test isn't working properly.
Diffstat (limited to 'src/Socket.cc')
-rw-r--r--src/Socket.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Socket.cc b/src/Socket.cc
index 65991a9..f14a8d3 100644
--- a/src/Socket.cc
+++ b/src/Socket.cc
@@ -390,7 +390,8 @@ bool Balau::Socket::connect(const char * hostname, int port) {
do {
Printer::elog(E_SOCKET, "Connecting now...");
- if (::connect(m_fd, (sockaddr *) &m_remoteAddr, sizeof(m_remoteAddr)) == 0) {
+ int r = ::connect(m_fd, (sockaddr *) &m_remoteAddr, sizeof(m_remoteAddr));
+ if ((r == 0) || ((r < 0) && (errno == EISCONN))) {
m_connected = true;
m_connecting = false;