From 3fa0e2a7455de5dbe44bafb5b59d2fe1b7f6474c Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 17 Mar 2016 05:39:53 +0100 Subject: [PATCH] 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 --- src/namespace.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/namespace.c b/src/namespace.c index f1e81df7c..108c994f3 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