Use more sensible value for #ifdef when checking for abstract unix sockets.
Signed-off-by: Gleb Popov <6yearold@gmail.com> Change-Id: Icfd849424659c8949f8f3554aa75a8a7ceaf7ac2
This commit is contained in:
parent
0dd30ba28f
commit
950a5c4d1a
1 changed files with 5 additions and 2 deletions
|
@ -53,6 +53,9 @@ constexpr std::chrono::microseconds WebSocketHandler::PingFrequencyMicroS;
|
||||||
std::atomic<bool> SocketPoll::InhibitThreadChecks(false);
|
std::atomic<bool> SocketPoll::InhibitThreadChecks(false);
|
||||||
std::atomic<bool> Socket::InhibitThreadChecks(false);
|
std::atomic<bool> Socket::InhibitThreadChecks(false);
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
|
#define HAVE_ABSTRACT_UNIX_SOCKETS
|
||||||
|
#endif
|
||||||
#define SOCKET_ABSTRACT_UNIX_NAME "0loolwsd-"
|
#define SOCKET_ABSTRACT_UNIX_NAME "0loolwsd-"
|
||||||
|
|
||||||
int Socket::createSocket(Socket::Type type)
|
int Socket::createSocket(Socket::Type type)
|
||||||
|
@ -518,7 +521,7 @@ void SocketPoll::insertNewUnixSocket(
|
||||||
struct sockaddr_un addrunix;
|
struct sockaddr_un addrunix;
|
||||||
std::memset(&addrunix, 0, sizeof(addrunix));
|
std::memset(&addrunix, 0, sizeof(addrunix));
|
||||||
addrunix.sun_family = AF_UNIX;
|
addrunix.sun_family = AF_UNIX;
|
||||||
#ifdef __linux__
|
#ifdef HAVE_ABSTRACT_UNIX_SOCKETS
|
||||||
addrunix.sun_path[0] = '\0'; // abstract name
|
addrunix.sun_path[0] = '\0'; // abstract name
|
||||||
#else
|
#else
|
||||||
addrunix.sun_path[0] = '0';
|
addrunix.sun_path[0] = '0';
|
||||||
|
@ -959,7 +962,7 @@ std::string LocalServerSocket::bind()
|
||||||
std::memset(&addrunix, 0, sizeof(addrunix));
|
std::memset(&addrunix, 0, sizeof(addrunix));
|
||||||
addrunix.sun_family = AF_UNIX;
|
addrunix.sun_family = AF_UNIX;
|
||||||
std::memcpy(addrunix.sun_path, socketAbstractUnixName.c_str(), socketAbstractUnixName.length());
|
std::memcpy(addrunix.sun_path, socketAbstractUnixName.c_str(), socketAbstractUnixName.length());
|
||||||
#ifdef __linux__
|
#ifdef HAVE_ABSTRACT_UNIX_SOCKETS
|
||||||
addrunix.sun_path[0] = '\0'; // abstract name
|
addrunix.sun_path[0] = '\0'; // abstract name
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue