Fix build on solaris

This commit is contained in:
Mikko Koppanen 2012-02-17 21:45:17 +00:00
parent cfe2a821f3
commit 56aa49ff3d

View File

@ -97,18 +97,18 @@ void zmq::ipc_listener_t::in_event ()
int zmq::ipc_listener_t::get_address (std::string *addr_) int zmq::ipc_listener_t::get_address (std::string *addr_)
{ {
struct sockaddr_un sun; struct sockaddr_un saddr;
int rc; int rc;
// Get the details of the IPC socket // Get the details of the IPC socket
socklen_t sl = sizeof(sockaddr_un); socklen_t sl = sizeof(sockaddr_un);
rc = getsockname (s, (sockaddr *)&sun, &sl); rc = getsockname (s, (sockaddr *)&saddr, &sl);
if (rc != 0) { if (rc != 0) {
return rc; return rc;
} }
// Store the address for retrieval by users using wildcards // Store the address for retrieval by users using wildcards
*addr_ = std::string("ipc://") + std::string(sun.sun_path); *addr_ = std::string("ipc://") + std::string(saddr.sun_path);
return 0; return 0;
} }