]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: 51d: register the deinitialization function
authorWilly Tarreau <w@1wt.eu>
Wed, 21 Dec 2016 19:59:01 +0000 (20:59 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 21 Dec 2016 20:30:54 +0000 (21:30 +0100)
deinit_51degrees() is not called anymore from haproxy.c, removing
2 #ifdefs and one include. The function was made static. The include
file still includes 51Degrees.h which is needed by global.h and 51d.c
so it was not touched beyond this last function removal.

include/import/51d.h
src/51d.c
src/haproxy.c

index 4bab242d7310b9f86b7c16cf668be7158c98612d..3d7a3c6ad2d1ba690c8d1f476326d3aaf181d4eb 100644 (file)
@@ -3,6 +3,4 @@
 
 #include <51Degrees.h>
 
-void deinit_51degrees(void);
-
 #endif
index 3e3133a14e459abe199264bbe054113b3b308a39..37ee90cece71302fe6cd44a860bc3ae30220e6b4 100644 (file)
--- a/src/51d.c
+++ b/src/51d.c
@@ -600,7 +600,7 @@ static int init_51degrees(void)
        return 0;
 }
 
-void deinit_51degrees(void)
+static void deinit_51degrees(void)
 {
        struct _51d_property_names *_51d_prop_name, *_51d_prop_nameb;
 
@@ -654,4 +654,5 @@ static void __51d_init(void)
        cfg_register_keywords(&_51dcfg_kws);
        hap_register_build_opts("Built with 51Degrees support.", 0);
        hap_register_post_check(init_51degrees);
+       hap_register_post_deinit(deinit_51degrees);
 }
index b222b095fa64b4734f903fd9467ecee233ad45d0..140c3e0f3d8cdcd71ef9c0f53ca6b9bbef66d835 100644 (file)
 #include <import/da.h>
 #endif
 
-#ifdef USE_51DEGREES
-#include <import/51d.h>
-#endif
-
 /* list of config files */
 static struct list cfg_cfgfiles = LIST_HEAD_INIT(cfg_cfgfiles);
 int  pid;                      /* current process id */
@@ -1579,10 +1575,6 @@ static void deinit(void)
        deinit_deviceatlas();
 #endif
 
-#ifdef USE_51DEGREES
-       deinit_51degrees();
-#endif
-
        list_for_each_entry(pdf, &post_deinit_list, list)
                pdf->fct();