From: Willy Tarreau Date: Thu, 17 Mar 2016 04:39:53 +0000 (+0100) Subject: BUILD: namespaces: fix a potential build warning in namespaces.c X-Git-Tag: v1.7-dev3~99 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fa0e2a7455de5dbe44bafb5b59d2fe1b7f6474c;p=thirdparty%2Fhaproxy.git BUILD: namespaces: fix a potential build warning in namespaces.c I just met this warning today making me realize that haproxy's headers were included prior to the system ones, so all #ifndefs are taken first then the system redefines them. Simply move haproxy includes after the system's. This should be backported to 1.6 as well. In file included from /usr/include/bits/fcntl.h:61:0, from /usr/include/fcntl.h:35, from src/namespace.c:13: /usr/include/bits/fcntl-linux.h:203:0: warning: "F_SETPIPE_SZ" redefined [enabled by default] In file included from include/common/config.h:26:0, from include/proto/log.h:29, from src/namespace.c:7: include/common/compat.h:81:0: note: this is the location of the previous definition --- diff --git a/src/namespace.c b/src/namespace.c index f1e81df7c4..108c994f3d 100644 --- a/src/namespace.c +++ b/src/namespace.c @@ -1,12 +1,5 @@ #define _GNU_SOURCE -#include -#include -#include -#include -#include -#include - #include #include #include @@ -16,6 +9,14 @@ #include #include + +#include +#include +#include +#include +#include +#include + #ifdef CONFIG_HAP_NS /* Opens the namespace and returns the FD or -1 in case of error