]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Cleanup some minor things in dynlibmod
authorPMunch <peterme@peterme.net>
Tue, 22 Oct 2019 06:42:00 +0000 (08:42 +0200)
committerPMunch <peterme@peterme.net>
Tue, 22 Oct 2019 06:42:00 +0000 (08:42 +0200)
dynlibmod/dynlibmod.c

index 54b2a5816729a805f02466dd6995bb929bad59c6..977f4504714faf918de93b338635e3de110bc0d7 100644 (file)
@@ -25,12 +25,12 @@ void log_dlerror() {
         NULL
         ))
     {
-        DWORD dwBytesWritten;
         log_err("dynlibmod: %s (%ld)", MessageBuffer, dwLastError);
         LocalFree(MessageBuffer);
     }
 
 }
+
 HMODULE open_library(const char* fname) {
     return LoadLibrary(fname);
 }
@@ -42,6 +42,7 @@ HMODULE open_library(const char* fname) {
 void log_dlerror() {
     log_err("dynlibmod: %s", dlerror());
 }
+
 void* open_library(const char* fname) {
     return dlopen(fname, RTLD_LAZY | RTLD_GLOBAL);
 }
@@ -60,10 +61,8 @@ typedef void (*func_clear_t)(struct module_qstate*, int);
 typedef size_t (*func_get_mem_t)(struct module_env*, int);
 
 struct dynlibmod_env {
-
        /** Dynamic library filename. */
        const char* fname;
-
        /** Module init function */
        func_init_t func_init;
        /** Module deinit function */
@@ -76,19 +75,11 @@ struct dynlibmod_env {
        func_clear_t func_clear;
        /** Module get_mem function */
        func_get_mem_t func_get_mem;
-
-       /** Module qstate. */
-       struct module_qstate* qstate;
 };
 
-/**
- * counter for dynamic library module instances
- * incremeted by dynlibmod_init
- */
-int dynlib_mod_count = 0;
-
 /** dynlib module init */
 int dynlibmod_init(struct module_env* env, int id) {
+    static int dynlib_mod_count;
     int dynlib_mod_idx = dynlib_mod_count++;
     struct config_strlist* cfg_item = env->cfg->dynlib_file;
     struct dynlibmod_env* de = (struct dynlibmod_env*)calloc(1, sizeof(struct dynlibmod_env));