suppress non linux network unused var warnings

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
This commit is contained in:
Kevin Darbyshire-Bryant
2020-03-06 10:31:15 +00:00
committed by Simon Kelley
parent ea3c60ac07
commit 70c50efd0d
2 changed files with 6 additions and 1 deletions

View File

@@ -1860,6 +1860,7 @@ static void check_dns_listeners(time_t now)
if (daemon->tcp_pids[i] == 0 && daemon->tcp_pipes[i] == -1) if (daemon->tcp_pids[i] == 0 && daemon->tcp_pipes[i] == -1)
{ {
char a; char a;
(void)a; /* suppress potential unused warning */
daemon->tcp_pids[i] = p; daemon->tcp_pids[i] = p;
daemon->tcp_pipes[i] = pipefd[0]; daemon->tcp_pipes[i] = pipefd[0];
@@ -1911,6 +1912,7 @@ static void check_dns_listeners(time_t now)
if (!option_bool(OPT_DEBUG)) if (!option_bool(OPT_DEBUG))
{ {
char a = 0; char a = 0;
(void)a; /* suppress potential unused warning */
alarm(CHILD_LIFETIME); alarm(CHILD_LIFETIME);
close(pipefd[0]); /* close read end in child. */ close(pipefd[0]); /* close read end in child. */
daemon->pipe_to_parent = pipefd[1]; daemon->pipe_to_parent = pipefd[1];

View File

@@ -785,6 +785,8 @@ int set_ipv6pktinfo(int fd)
/* Find the interface on which a TCP connection arrived, if possible, or zero otherwise. */ /* Find the interface on which a TCP connection arrived, if possible, or zero otherwise. */
int tcp_interface(int fd, int af) int tcp_interface(int fd, int af)
{ {
(void)fd; /* suppress potential unused warning */
(void)af; /* suppress potential unused warning */
int if_index = 0; int if_index = 0;
#ifdef HAVE_LINUX_NETWORK #ifdef HAVE_LINUX_NETWORK
@@ -1187,6 +1189,7 @@ int local_bind(int fd, union mysockaddr *addr, char *intname, unsigned int ifind
#endif #endif
} }
(void)intname; /* suppress potential unused warning */
#if defined(SO_BINDTODEVICE) #if defined(SO_BINDTODEVICE)
if (intname[0] != 0 && if (intname[0] != 0 &&
setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, intname, IF_NAMESIZE) == -1) setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, intname, IF_NAMESIZE) == -1)