Only define variable "a" if we HAVE_LINUX_NETWORK

Variable unsigned char a is defined unconditionally,
but it is only used if HAVE_LINUX_NETWORK is defined.
This triggers compiler warnings on, say, FreeBSD.

Fix by wrapping the definition in proper #ifdef.
This commit is contained in:
Matthias Andree
2025-05-21 20:41:33 +02:00
committed by Simon Kelley
parent 96bdb42d40
commit 1861a881eb

View File

@@ -1939,11 +1939,14 @@ static void do_tcp_connection(struct listener *listener, time_t now, int slot)
pid_t p;
union mysockaddr tcp_addr;
socklen_t tcp_len = sizeof(union mysockaddr);
unsigned char a = 0, *buff;
unsigned char *buff;
struct server *s;
int flags, auth_dns;
struct in_addr netmask;
int pipefd[2];
#ifdef HAVE_LINUX_NETWORK
unsigned char a = 0;
#endif
while ((confd = accept(listener->tcpfd, NULL, NULL)) == -1 && errno == EINTR);