[PATCH 09/32] lib/smokey: Move do_fork macro to its single user

Florian Bezdeka <[email protected]>
Newsgroups dev.linux.lists.xenomai
Message-ID <[email protected]>
lib/smokey/helpers.c is the only user of that macro. Move the
definition close to the user.

Signed-off-by: Florian Bezdeka <[email protected]>
---
 include/smokey/smokey.h | 6 ------
 lib/smokey/helpers.c    | 7 +++++++
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/include/smokey/smokey.h b/include/smokey/smokey.h
index 45dd0dcd017b092d86d0978713e67a92ab01e1df..64593c1a73d5b84fde286ed23b2f2d043d795db9 100644
--- a/include/smokey/smokey.h
+++ b/include/smokey/smokey.h
@@ -26,12 +26,6 @@
 #include <copperplate/clockobj.h>
 #include <xenomai/init.h>
 
-#ifdef HAVE_FORK
-#define do_fork fork
-#else
-#define do_fork vfork
-#endif
-
 #define SMOKEY_INT(__name) {		\
 	 .name = # __name,		\
 	 .parser = smokey_int,		\
diff --git a/lib/smokey/helpers.c b/lib/smokey/helpers.c
index fe52f48db08628b79df6e8331e0f67bdf45f7cfa..a22953a9f0f3784ac8b265bfe53ddd45ab2b9351 100644
--- a/lib/smokey/helpers.c
+++ b/lib/smokey/helpers.c
@@ -23,6 +23,13 @@
 #include <error.h>
 #include <stdlib.h>
 #include <sys/wait.h>
+#include <unistd.h>
+
+#ifdef HAVE_FORK
+#define do_fork fork
+#else
+#define do_fork vfork
+#endif
 
 int smokey_int(const char *s, struct smokey_arg *arg)
 {

-- 
2.54.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.