From a3c9f9ee559b6aa14be5d01cf8bdb0c854f330f0 Mon Sep 17 00:00:00 2001 From: Paul Donald Date: Thu, 25 Apr 2024 04:02:04 +0200 Subject: [PATCH] Fix macos warnings at compile time. If this happens: lldpd.c:1577:14: warning: variable 'pidfile' set but not used [-Wunused-but-set-variable] const char *pidfile = LLDPD_PID_FILE; Then the other places using pidfile should get the same ifndef treatment --- src/daemon/lldpd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/daemon/lldpd.c b/src/daemon/lldpd.c index 54864753..0f30f426 100644 --- a/src/daemon/lldpd.c +++ b/src/daemon/lldpd.c @@ -1574,7 +1574,9 @@ lldpd_main(int argc, char *argv[], char *envp[]) char *platform_override = NULL; char *lsb_release = NULL; const char *lldpcli = LLDPCLI_PATH; +#ifndef HOST_OS_OSX const char *pidfile = LLDPD_PID_FILE; +#endif int smart = 15; int receiveonly = 0, version = 0; int ctl; @@ -1621,9 +1623,11 @@ lldpd_main(int argc, char *argv[], char *envp[]) case 'D': log_accept(optarg); break; +#ifndef HOST_OS_OSX case 'p': pidfile = optarg; break; +#endif case 'r': receiveonly = 1; break; -- 2.39.5