]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
daemon: move vfork/fork handling directly in lldpd.c
authorVincent Bernat <vincent@bernat.im>
Sun, 31 Dec 2017 11:57:52 +0000 (12:57 +0100)
committerVincent Bernat <vincent@bernat.im>
Sun, 31 Dec 2017 11:57:52 +0000 (12:57 +0100)
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
src/daemon/lldpd.h

index b726882eb7cc33767bef176ed2d35a22f25ee3c4..3affe2811f79f2d82320f8511a167b0ee711bc48 100644 (file)
 #include <pwd.h>
 #include <grp.h>
 
+#if HAVE_VFORK_H
+# include <vfork.h>
+#endif
+#if HAVE_WORKING_FORK
+# define vfork fork
+#endif
+
 static void             usage(void);
 
 static struct protocol protos[] =
index 55fcfa3835736a54010290a07626c6281169f6eb..97306a2d47733e241d6ab512e0427b27df473f92 100644 (file)
 #include <netinet/in.h>
 #include <sys/un.h>
 
-#if HAVE_VFORK_H
-# include <vfork.h>
-#endif
-#if HAVE_WORKING_FORK
-# define vfork fork
-#endif
-
 #include "lldp-tlv.h"
 #if defined (ENABLE_CDP) || defined (ENABLE_FDP)
 #  include "protocols/cdp.h"