]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
Eliminate unused arguments to priv_init() with --disable-privsep.
authorJohn Lindgren <john.lindgren@avasure.com>
Mon, 8 Mar 2021 17:06:47 +0000 (12:06 -0500)
committerVincent Bernat <vincent@bernat.ch>
Mon, 8 Mar 2021 20:45:41 +0000 (21:45 +0100)
This seems a bit cleaner than passing dummy values (e.g. 0) that
aren't ever used.  Additionally, it means that PRIVSEP_CHROOT no
longer needs to be defined to a dummy value if building with
--disable-privsep.

src/daemon/lldpd.c
src/daemon/lldpd.h
src/daemon/priv.c

index db4e24a5f1a601cb457053efe392fd82b1df3f13..5dd2413adf549222d1aaea6c5b0c4b77078c1598 100644 (file)
@@ -1844,7 +1844,7 @@ lldpd_main(int argc, char *argv[], char *envp[])
 #ifdef ENABLE_PRIVSEP
        priv_init(PRIVSEP_CHROOT, ctl, uid, gid);
 #else
-       priv_init(PRIVSEP_CHROOT, ctl, 0, 0);
+       priv_init();
 #endif
 
        /* Initialization of global configuration */
index 32581e5985b7f5c0fd5e1a83573e59a2a6c0c1d3..7b2ea9160726fc2c5bca4b92132d4496c154354f 100644 (file)
@@ -194,7 +194,11 @@ client_handle_client(struct lldpd *cfg,
     int*);
 
 /* priv.c */
+#ifdef ENABLE_PRIVSEP
 void    priv_init(const char*, int, uid_t, gid_t);
+#else
+void    priv_init(void);
+#endif
 void    priv_wait(void);
 void    priv_ctl_cleanup(const char *ctlname);
 char           *priv_gethostname(void);
index ba5ae58c7392476bf13e455f95b7c3ef50a4a8e9..78ac3351962e7d20f7aec4ae7a77d73f54381d4d 100644 (file)
@@ -682,7 +682,11 @@ priv_caps(uid_t uid, gid_t gid)
 }
 
 void
+#ifdef ENABLE_PRIVSEP
 priv_init(const char *chrootdir, int ctl, uid_t uid, gid_t gid)
+#else
+priv_init(void)
+#endif
 {
 
        int pair[2];