]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
iputils: avoid unused warnings on !linux 13693/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 10 Jan 2024 10:54:46 +0000 (11:54 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 10 Jan 2024 10:54:46 +0000 (11:54 +0100)
pdns/iputils.cc

index 55d8daad5a363f5c54d92320c0118682ffb1447b..82f4eab480480ef791c3f254f36c0b71faa5a844 100644 (file)
@@ -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");