]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: da: register the deinitialization function
authorWilly Tarreau <w@1wt.eu>
Wed, 21 Dec 2016 20:03:49 +0000 (21:03 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 21 Dec 2016 20:30:54 +0000 (21:30 +0100)
deinit_deviceatlas() is not called anymore from haproxy.c, removing 2
still includes other parts of the Deviceatlas library so it was not
touched.

include/import/da.h
src/da.c
src/haproxy.c

index 90e1f7d0db22cb900ea60ef1da101f4deb4161ac..3817e5ddba574823aabfb3a3c377482edf6bb7bf 100644 (file)
@@ -5,6 +5,5 @@
 #include <types/global.h>
 #include <dac.h>
 
-void deinit_deviceatlas(void);
 #endif
 #endif
index 843da9fa7c8a3b579e0c37c8e14a708f90857b83..9ea266f2ce65dc2709ce666b5d25d52f6b5f2556 100644 (file)
--- a/src/da.c
+++ b/src/da.c
@@ -146,7 +146,7 @@ out:
        return err_code;
 }
 
-void deinit_deviceatlas(void)
+static void deinit_deviceatlas(void)
 {
        if (global.deviceatlas.jsonpath != 0) {
                free(global.deviceatlas.jsonpath);
@@ -374,4 +374,5 @@ static void __da_init(void)
        cfg_register_keywords(&dacfg_kws);
        hap_register_build_opts("Built with DeviceAtlas support.", 0);
        hap_register_post_check(init_deviceatlas);
+       hap_register_post_deinit(deinit_deviceatlas);
 }
index 140c3e0f3d8cdcd71ef9c0f53ca6b9bbef66d835..be6fa66de9ab5f005dfb70381df9a7243da49ad8 100644 (file)
 #include <proto/ssl_sock.h>
 #endif
 
-#ifdef USE_DEVICEATLAS
-#include <import/da.h>
-#endif
-
 /* list of config files */
 static struct list cfg_cfgfiles = LIST_HEAD_INIT(cfg_cfgfiles);
 int  pid;                      /* current process id */
@@ -1571,10 +1567,6 @@ static void deinit(void)
 
        protocol_unbind_all();
 
-#if defined(USE_DEVICEATLAS)
-       deinit_deviceatlas();
-#endif
-
        list_for_each_entry(pdf, &post_deinit_list, list)
                pdf->fct();