From bf0c68757f99f88b43d7696f98d8361f39b83b82 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Tue, 26 Feb 2019 11:25:44 +0100 Subject: [PATCH] Don't require OS headers to provide SO_REUSEPORT --- lib/base/tcpsocket.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/base/tcpsocket.cpp b/lib/base/tcpsocket.cpp index a06b21106..a9390e5a7 100644 --- a/lib/base/tcpsocket.cpp +++ b/lib/base/tcpsocket.cpp @@ -74,9 +74,9 @@ void TcpSocket::Bind(const String& node, const String& service, int family) const int optTrue = 1; setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, reinterpret_cast(&optTrue), sizeof(optTrue)); -#ifndef _WIN32 +#ifdef SO_REUSEPORT setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, reinterpret_cast(&optTrue), sizeof(optTrue)); -#endif /* _WIN32 */ +#endif /* SO_REUSEPORT */ int rc = bind(fd, info->ai_addr, info->ai_addrlen);