diff options
author | Mathias Stearn <mathias@10gen.com> | 2010-04-05 21:18:45 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2010-04-05 21:46:04 -0400 |
commit | afafbfa5a7924889bcd4e409b570db7d2d07ecb0 (patch) | |
tree | f6a43d2c8c02abfd4dc8931f8334c2a8b7c10e80 /util/sock.h | |
parent | d02c18cde4f2658426c5f7269d0a74dbc51b7bd6 (diff) | |
download | mongo-afafbfa5a7924889bcd4e409b570db7d2d07ecb0.tar.gz |
Better getAddr for unix sockets
Diffstat (limited to 'util/sock.h')
-rw-r--r-- | util/sock.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/util/sock.h b/util/sock.h index 408bdb94db9..0a51c04daaa 100644 --- a/util/sock.h +++ b/util/sock.h @@ -167,7 +167,7 @@ namespace mongo { case AF_INET: return inet_ntop(getType(), &as<sockaddr_in>().sin_addr, buffer, addressSize); case AF_INET6: return inet_ntop(getType(), &as<sockaddr_in6>().sin6_addr, buffer, addressSize); #endif - case AF_UNIX: return as<sockaddr_un>().sun_path; + case AF_UNIX: return (addressSize > 2 ?as<sockaddr_un>().sun_path : "anonymous unix socket"); case AF_UNSPEC: return "(NONE)"; default: massert(SOCK_FAMILY_UNKNOWN_ERROR, "unsupported address family", false); return ""; } |