From: Willy Tarreau Date: Wed, 21 Dec 2016 17:51:45 +0000 (+0100) Subject: CLEANUP: namespaces: use the build options list to report it X-Git-Tag: v1.8-dev1~242 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dba5002c4c1488266058c390e75635915cdb88d4;p=thirdparty%2Fhaproxy.git CLEANUP: namespaces: use the build options list to report it This removes one #ifdef from haproxy.c. --- 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); +}