Commit 51e012c4 authored by Martin Sustrik's avatar Martin Sustrik

Solaris build fixed

parent a507d16e
...@@ -7,6 +7,7 @@ Conrad D. Steenberg ...@@ -7,6 +7,7 @@ Conrad D. Steenberg
Dhruva Krishnamurthy Dhruva Krishnamurthy
Dirk O. Kaar Dirk O. Kaar
Erich Heine Erich Heine
Erik Rigtorp
Frank Denis Frank Denis
George Neill George Neill
Jon Dyte Jon Dyte
......
...@@ -320,7 +320,7 @@ int zmq::resolve_local_path (sockaddr_un *addr_, const char *path_) ...@@ -320,7 +320,7 @@ int zmq::resolve_local_path (sockaddr_un *addr_, const char *path_)
return -1; return -1;
} }
strcpy (addr_->sun_path, path_); strcpy (addr_->sun_path, path_);
addr_->sun_family = AF_LOCAL; addr_->sun_family = AF_UNIX;
return 0; return 0;
} }
......
...@@ -211,8 +211,10 @@ int zmq::tcp_connecter_t::open () ...@@ -211,8 +211,10 @@ int zmq::tcp_connecter_t::open ()
errno = err; errno = err;
return -1; return -1;
} }
else if (AF_LOCAL == sa->sa_family) { else if (AF_UNIX == sa->sa_family) {
s = socket (AF_LOCAL, SOCK_STREAM, 0);
// Create the socket.
s = socket (AF_UNIX, SOCK_STREAM, 0);
if (s == -1) if (s == -1)
return -1; return -1;
......
...@@ -207,7 +207,7 @@ int zmq::tcp_listener_t::set_address (const char *protocol_, const char *addr_) ...@@ -207,7 +207,7 @@ int zmq::tcp_listener_t::set_address (const char *protocol_, const char *addr_)
return -1; return -1;
// Create a listening socket. // Create a listening socket.
s = socket (AF_LOCAL, SOCK_STREAM, 0); s = socket (AF_UNIX, SOCK_STREAM, 0);
if (s == -1) if (s == -1)
return -1; return -1;
...@@ -250,9 +250,8 @@ int zmq::tcp_listener_t::close () ...@@ -250,9 +250,8 @@ int zmq::tcp_listener_t::close ()
// If there's an underlying UNIX domain socket, get rid of the file it // If there's an underlying UNIX domain socket, get rid of the file it
// is associated with. // 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); rc = ::unlink(sun->sun_path);
if (rc != 0) if (rc != 0)
return -1; return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment