diff --git a/src/haproxy.c b/src/haproxy.c index 63edbd6a8..22b6ffaee 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 e5ebfd776..a8f14c8b3 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); +}