summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ip.cpp2
-rw-r--r--src/tcp_connecter.cpp6
-rw-r--r--src/tcp_listener.cpp7
3 files changed, 8 insertions, 7 deletions
diff --git a/src/ip.cpp b/src/ip.cpp
index d5bb05d..86fa2c8 100644
--- a/src/ip.cpp
+++ b/src/ip.cpp
@@ -320,7 +320,7 @@ int zmq::resolve_local_path (sockaddr_un *addr_, const char *path_)
return -1;
}
strcpy (addr_->sun_path, path_);
- addr_->sun_family = AF_LOCAL;
+ addr_->sun_family = AF_UNIX;
return 0;
}
diff --git a/src/tcp_connecter.cpp b/src/tcp_connecter.cpp
index f148ae4..6b7819b 100644
--- a/src/tcp_connecter.cpp
+++ b/src/tcp_connecter.cpp
@@ -211,8 +211,10 @@ int zmq::tcp_connecter_t::open ()
errno = err;
return -1;
}
- else if (AF_LOCAL == sa->sa_family) {
- s = socket (AF_LOCAL, SOCK_STREAM, 0);
+ else if (AF_UNIX == sa->sa_family) {
+
+ // Create the socket.
+ s = socket (AF_UNIX, SOCK_STREAM, 0);
if (s == -1)
return -1;
diff --git a/src/tcp_listener.cpp b/src/tcp_listener.cpp
index 9a9850d..2323e31 100644
--- a/src/tcp_listener.cpp
+++ b/src/tcp_listener.cpp
@@ -207,7 +207,7 @@ int zmq::tcp_listener_t::set_address (const char *protocol_, const char *addr_)
return -1;
// Create a listening socket.
- s = socket (AF_LOCAL, SOCK_STREAM, 0);
+ s = socket (AF_UNIX, SOCK_STREAM, 0);
if (s == -1)
return -1;
@@ -250,9 +250,8 @@ int zmq::tcp_listener_t::close ()
// If there's an underlying UNIX domain socket, get rid of the file it
// is associated with.
- struct sockaddr *sa = (struct sockaddr*) &addr;
- if (AF_LOCAL == sa->sa_family) {
- struct sockaddr_un *sun = (struct sockaddr_un*) &addr;
+ struct sockaddr_un *sun = (struct sockaddr_un*) &addr;
+ if (AF_UNIX == sun->sun_family) {
rc = ::unlink(sun->sun_path);
if (rc != 0)
return -1;