From f36b76c1aff77f6cc195afcb5c2398cdc512bd03 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sun, 31 Dec 2017 12:57:52 +0100 Subject: [PATCH] daemon: move vfork/fork handling directly in lldpd.c This is not needed elsewhere. This way, we ensure redefinition of vfork() to fork() through a define is working as expected, even when some system headers may try to rename vfork too. Fix #264 --- src/daemon/lldpd.c | 7 +++++++ src/daemon/lldpd.h | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/daemon/lldpd.c b/src/daemon/lldpd.c index b726882e..3affe281 100644 --- a/src/daemon/lldpd.c +++ b/src/daemon/lldpd.c @@ -40,6 +40,13 @@ #include #include +#if HAVE_VFORK_H +# include +#endif +#if HAVE_WORKING_FORK +# define vfork fork +#endif + static void usage(void); static struct protocol protos[] = diff --git a/src/daemon/lldpd.h b/src/daemon/lldpd.h index 55fcfa38..97306a2d 100644 --- a/src/daemon/lldpd.h +++ b/src/daemon/lldpd.h @@ -37,13 +37,6 @@ #include #include -#if HAVE_VFORK_H -# include -#endif -#if HAVE_WORKING_FORK -# define vfork fork -#endif - #include "lldp-tlv.h" #if defined (ENABLE_CDP) || defined (ENABLE_FDP) # include "protocols/cdp.h" -- 2.39.5