]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
Fix macos warnings at compile time.
authorPaul Donald <newtwen+github@gmail.com>
Thu, 25 Apr 2024 02:02:04 +0000 (04:02 +0200)
committerVincent Bernat <vincent@bernat.ch>
Thu, 25 Apr 2024 05:32:47 +0000 (07:32 +0200)
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

index 5486475336e69b995ea7958128f4c3a9e7d6b453..0f30f426246aad796bcf0f72e4aaa977a769d6a0 100644 (file)
@@ -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;