summaryrefslogtreecommitdiff
path: root/src/tcp_connecter.cpp
diff options
context:
space:
mode:
authorMartin Lucina <mato@kotelna.sk>2011-10-03 17:09:06 +0200
committerMartin Lucina <martin@lucina.net>2012-01-23 08:54:33 +0100
commitc3363afa881b46f3df8a6b72ed15cfbac18f4713 (patch)
tree832e8075a038b49f81e8a7635344f1647007fd15 /src/tcp_connecter.cpp
parent88f712b4a31c95caef4f34c4ec65793c392314a6 (diff)
parent978e33ba253a997b41b331b449b474a5cee7bccc (diff)
Imported Debian patch 2.1.10-1debian/2.1.10-1
Diffstat (limited to 'src/tcp_connecter.cpp')
-rw-r--r--src/tcp_connecter.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/tcp_connecter.cpp b/src/tcp_connecter.cpp
index d6f73ca..6bc1b2d 100644
--- a/src/tcp_connecter.cpp
+++ b/src/tcp_connecter.cpp
@@ -50,7 +50,7 @@ int zmq::tcp_connecter_t::set_address (const char *protocol_, const char *addr_)
return resolve_ip_hostname (&addr, &addr_len, addr_);
errno = EPROTONOSUPPORT;
- return -1;
+ return -1;
}
int zmq::tcp_connecter_t::open ()
@@ -58,7 +58,7 @@ int zmq::tcp_connecter_t::open ()
zmq_assert (s == retired_fd);
// Create the socket.
- s = socket (addr.ss_family, SOCK_STREAM, IPPROTO_TCP);
+ s = open_socket (addr.ss_family, SOCK_STREAM, IPPROTO_TCP);
if (s == INVALID_SOCKET) {
wsa_error_to_errno ();
return -1;
@@ -88,7 +88,7 @@ int zmq::tcp_connecter_t::open ()
errno = EAGAIN;
return -1;
}
-
+
wsa_error_to_errno ();
return -1;
}
@@ -162,7 +162,8 @@ int zmq::tcp_connecter_t::set_address (const char *protocol_, const char *addr_)
{
if (strcmp (protocol_, "tcp") == 0)
return resolve_ip_hostname (&addr, &addr_len, addr_);
- else if (strcmp (protocol_, "ipc") == 0)
+ else
+ if (strcmp (protocol_, "ipc") == 0)
return resolve_local_path (&addr, &addr_len, addr_);
errno = EPROTONOSUPPORT;
@@ -177,7 +178,7 @@ int zmq::tcp_connecter_t::open ()
if (AF_UNIX != sa->sa_family) {
// Create the socket.
- s = socket (sa->sa_family, SOCK_STREAM, IPPROTO_TCP);
+ s = open_socket (sa->sa_family, SOCK_STREAM, IPPROTO_TCP);
if (s == -1)
return -1;
@@ -233,13 +234,13 @@ int zmq::tcp_connecter_t::open ()
// Create the socket.
zmq_assert (AF_UNIX == sa->sa_family);
- s = socket (AF_UNIX, SOCK_STREAM, 0);
+ s = open_socket (AF_UNIX, SOCK_STREAM, 0);
if (s == -1)
return -1;
// Set the non-blocking flag.
int flag = fcntl (s, F_GETFL, 0);
- if (flag == -1)
+ if (flag == -1)
flag = 0;
int rc = fcntl (s, F_SETFL, flag | O_NONBLOCK);
errno_assert (rc != -1);