From: Willy Tarreau Date: Wed, 21 Dec 2016 19:52:38 +0000 (+0100) Subject: CLEANUP: wurfl: register the deinit function via the dedicated list X-Git-Tag: v1.8-dev1~228 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=800f93f3751db98f0d147fa773c97f07d6f471f9;p=thirdparty%2Fhaproxy.git CLEANUP: wurfl: register the deinit function via the dedicated list By registering the deinit function we avoid another #ifdef in haproxy.c. The ha_wurfl_deinit() function has been made static and unexported. Now proto/wurfl.h is totally empty, the code being self-contained in wurfl.c, so the useless .h has been removed. --- diff --git a/include/proto/wurfl.h b/include/proto/wurfl.h deleted file mode 100644 index 2dac8dee1d..0000000000 --- a/include/proto/wurfl.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _PROTO_WURFL_H -#define _PROTO_WURFL_H - -void ha_wurfl_deinit(void); - -#endif diff --git a/src/haproxy.c b/src/haproxy.c index 06fc895528..b222b095fa 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -113,10 +113,6 @@ #include #endif -#ifdef USE_WURFL -#include -#endif - #ifdef USE_DEVICEATLAS #include #endif @@ -1587,10 +1583,6 @@ static void deinit(void) deinit_51degrees(); #endif -#ifdef USE_WURFL - ha_wurfl_deinit(); -#endif - list_for_each_entry(pdf, &post_deinit_list, list) pdf->fct(); diff --git a/src/wurfl.c b/src/wurfl.c index 37205a4c18..2b4a28da04 100644 --- a/src/wurfl.c +++ b/src/wurfl.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include @@ -475,7 +474,7 @@ static int ha_wurfl_init(void) return 0; } -void ha_wurfl_deinit(void) +static void ha_wurfl_deinit(void) { wurfl_information_t *wi, *wi2; wurfl_patches_t *wp, *wp2; @@ -675,6 +674,7 @@ static void __wurfl_init(void) cfg_register_keywords(&wurflcfg_kws); hap_register_build_opts("Built with WURFL support.", 0); hap_register_post_check(ha_wurfl_init); + hap_register_post_deinit(ha_wurfl_deinit); } // WURFL properties wrapper functions