From 546c3c26d306494eecfa065a5f64008ba9a027bf Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Sun, 19 May 2019 13:10:06 -0500 Subject: [PATCH] simauth: Convert to use IWD_MODULE --- src/iwd.h | 3 --- src/main.c | 4 +--- src/simauth.c | 7 +++++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/iwd.h b/src/iwd.h index 13ab9570..ab990c64 100644 --- a/src/iwd.h +++ b/src/iwd.h @@ -36,9 +36,6 @@ void netdev_shutdown(void); void network_init(); void network_exit(); -void sim_auth_init(void); -void sim_auth_exit(void); - bool wsc_init(void); bool wsc_exit(); diff --git a/src/main.c b/src/main.c index 6b8b5d40..b0a7bfa6 100644 --- a/src/main.c +++ b/src/main.c @@ -42,7 +42,6 @@ #include "src/rfkill.h" #include "src/ap.h" #include "src/plugin.h" -#include "src/simauth.h" #include "src/adhoc.h" #include "src/storage.h" @@ -529,7 +528,7 @@ int main(int argc, char *argv[]) wsc_init(); network_init(); known_networks_init(); - sim_auth_init(); + if (iwd_modules_init() < 0) goto fail_modules; @@ -540,7 +539,6 @@ int main(int argc, char *argv[]) fail_modules: iwd_modules_exit(); - sim_auth_exit(); known_networks_exit(); network_exit(); wsc_exit(); diff --git a/src/simauth.c b/src/simauth.c index 4244304a..51f2bdbe 100644 --- a/src/simauth.c +++ b/src/simauth.c @@ -179,15 +179,18 @@ void sim_auth_cancel_request(struct iwd_sim_auth *auth, int id) auth->driver->cancel_request(auth, id); } -void sim_auth_init(void) +static int sim_auth_init(void) { auth_providers = l_queue_new(); + return 0; } -void sim_auth_exit(void) +static void sim_auth_exit(void) { if (l_queue_length(auth_providers) > 0) l_warn("Auth provider queue was not empty on exit!"); l_queue_destroy(auth_providers, destroy_provider); } + +IWD_MODULE(simauth, sim_auth_init, sim_auth_exit)