fixes for building with Sun CC

This commit is contained in:
Martin Sustrik 2010-03-19 09:14:26 +01:00
parent ae35a1644c
commit cbaf10978a
2 changed files with 5 additions and 4 deletions

View File

@ -264,7 +264,8 @@ int zmq::dispatcher_t::register_endpoint (const char *addr_,
{ {
endpoints_sync.lock (); endpoints_sync.lock ();
bool inserted = endpoints.insert (std::make_pair (addr_, socket_)).second; bool inserted = endpoints.insert (std::make_pair (std::string (addr_),
socket_)).second;
if (!inserted) { if (!inserted) {
errno = EADDRINUSE; errno = EADDRINUSE;
endpoints_sync.unlock (); endpoints_sync.unlock ();

View File

@ -251,9 +251,9 @@ 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_un *sun = (struct sockaddr_un*) &addr; struct sockaddr_un *su = (struct sockaddr_un*) &addr;
if (AF_UNIX == sun->sun_family) { if (AF_UNIX == su->sun_family) {
rc = ::unlink(sun->sun_path); rc = ::unlink(su->sun_path);
if (rc != 0) if (rc != 0)
return -1; return -1;
} }