From 4bf9c99828bca0c20562dde3133981e3d534dbe1 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Wed, 10 Jan 2024 11:54:46 +0100 Subject: [PATCH] iputils: avoid unused warnings on !linux --- pdns/iputils.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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"); -- 2.47.2