Mercurial > code
changeset 450:f5b491a14a28
Socket: use AF_LOCAL
author | David Demelier <markand@malikania.fr> |
---|---|
date | Sat, 31 Oct 2015 10:38:10 +0100 |
parents | c3d55937754f |
children | 902b034df6e3 |
files | C++/modules/Socket/Sockets.cpp |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/C++/modules/Socket/Sockets.cpp Thu Oct 29 21:10:56 2015 +0100 +++ b/C++/modules/Socket/Sockets.cpp Sat Oct 31 10:38:10 2015 +0100 @@ -245,16 +245,16 @@ std::strncpy(m_sun.sun_path, m_path.c_str(), sizeof (m_sun.sun_path) - 1); /* Set the parameters */ - m_sun.sun_family = AF_UNIX; + m_sun.sun_family = AF_LOCAL; } Local::Local(const sockaddr_storage *ss, socklen_t length) { - if (ss->ss_family == AF_UNIX) { + if (ss->ss_family == AF_LOCAL) { std::memcpy(&m_sun, ss, length); m_path = reinterpret_cast<const sockaddr_un &>(m_sun).sun_path; } else { - throw std::invalid_argument{"invalid domain for local constructor"}; + throw std::invalid_argument{"invalid domain for Local constructor"}; } }