From dba5002c4c1488266058c390e75635915cdb88d4 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 21 Dec 2016 18:51:45 +0100 Subject: [PATCH] CLEANUP: namespaces: use the build options list to report it This removes one #ifdef from haproxy.c. --- src/haproxy.c | 4 ---- src/namespace.c | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/haproxy.c b/src/haproxy.c index 63edbd6a8d..22b6ffaee9 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -454,10 +454,6 @@ static void display_build_opts() "\n"); #endif -#if defined(CONFIG_HAP_NS) - printf("Built with network namespace support\n"); -#endif - list_for_each_entry(item, &build_opts_list, list) { puts(item->str); } diff --git a/src/namespace.c b/src/namespace.c index e5ebfd7767..a8f14c8b32 100644 --- a/src/namespace.c +++ b/src/namespace.c @@ -112,3 +112,9 @@ int my_socketat(const struct netns_entry *ns, int domain, int type, int protocol return sock; } + +__attribute__((constructor)) +static void __ns_init(void) +{ + hap_register_build_opts("Built with network namespace support.", 0); +} -- 2.47.3