From: Otto Moerbeek Date: Wed, 10 Jan 2024 10:54:46 +0000 (+0100) Subject: iputils: avoid unused warnings on !linux X-Git-Tag: auth-4.9.0-alpha1~3^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4bf9c99828bca0c20562dde3133981e3d534dbe1;p=thirdparty%2Fpdns.git iputils: avoid unused warnings on !linux --- diff --git a/pdns/iputils.cc b/pdns/iputils.cc index 55d8daad5a..82f4eab480 100644 --- a/pdns/iputils.cc +++ b/pdns/iputils.cc @@ -559,6 +559,7 @@ void setSocketSendBuffer(int fd, uint32_t size) setSocketBuffer(fd, SO_SNDBUF, size); } +#ifdef __linux__ static uint32_t raiseSocketBufferToMax(int socket, int optname, const std::string& readMaxFromFile) { std::ifstream ifs(readMaxFromFile); @@ -572,8 +573,9 @@ static uint32_t raiseSocketBufferToMax(int socket, int optname, const std::strin } return 0; } +#endif -uint32_t raiseSocketReceiveBufferToMax(int socket) +uint32_t raiseSocketReceiveBufferToMax([[maybe_unused]] int socket) { #ifdef __linux__ return raiseSocketBufferToMax(socket, SO_RCVBUF, "/proc/sys/net/core/rmem_max"); @@ -582,7 +584,7 @@ uint32_t raiseSocketReceiveBufferToMax(int socket) #endif } -uint32_t raiseSocketSendBufferToMax(int socket) +uint32_t raiseSocketSendBufferToMax([[maybe_unused]] int socket) { #ifdef __linux__ return raiseSocketBufferToMax(socket, SO_SNDBUF, "/proc/sys/net/core/wmem_max");