From: Roy Marples Date: Wed, 23 Apr 2014 09:43:30 +0000 (+0000) Subject: Define a macro to include spawn.h or compat/spawn.h instead of forcing it in. X-Git-Tag: v6.4.0~114 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1596f0102fd6f40a8e84f2f9fba9f53a45e21442;p=thirdparty%2Fdhcpcd.git Define a macro to include spawn.h or compat/spawn.h instead of forcing it in. --- diff --git a/configure b/configure index 7b3975dc..8d751877 100755 --- a/configure +++ b/configure @@ -526,7 +526,7 @@ EOF fi if [ "$STRLCPY" = no ]; then echo "COMPAT_SRCS+= compat/strlcpy.c" >>$CONFIG_MK - echo "#include \"compat/strlcpy.h\"" >>$CONFIG_H + echo "#include \"compat/strlcpy.h\"" >>$CONFIG_H fi if [ -z "$TAILQ_FOREACH_SAFE" ]; then @@ -594,9 +594,8 @@ EOF fi if [ "$POSIX_SPAWN" = no ]; then echo "COMPAT_SRCS+= compat/posix_spawn.c" >>$CONFIG_MK - echo "#include \"compat/posix_spawn.h\"" >>$CONFIG_H else - echo "#include " >>$CONFIG_H + echo "#define HAVE_SPAWN_H" >>$CONFIG_H fi if [ -z "$POLLTS" ]; then @@ -661,15 +660,15 @@ case "$POLLTS" in yes) ;; ppoll) - echo "#define pollts ppoll" >>$CONFIG_H + echo "#define pollts ppoll" >>$CONFIG_H ;; pselect) echo "COMPAT_SRCS+= compat/pselect.c" >>$CONFIG_MK - echo "#include \"compat/pollts.h\"" >>$CONFIG_H + echo "#include \"compat/pollts.h\"" >>$CONFIG_H ;; *) echo "COMPAT_SRCS+= compat/pollts.c" >>$CONFIG_MK - echo "#include \"compat/pollts.h\"" >>$CONFIG_H + echo "#include \"compat/pollts.h\"" >>$CONFIG_H ;; esac diff --git a/script.c b/script.c index 3ee71d21..cbcf68c7 100644 --- a/script.c +++ b/script.c @@ -52,6 +52,12 @@ #include "net.h" #include "script.h" +#ifdef HAVE_SPAWN_H +#include +#else +#include "compat/posix_spawn.h" +#endif + #define DEFAULT_PATH "PATH=/usr/bin:/usr/sbin:/bin:/sbin" static const char * const if_params[] = {