commit 6b58ab1a085a9b135f608cc2551a0cd350996e7f
parent 8cf44499d19ce710e0e432af86041e1369204f9f
Author: Denis Kenzior <denkenz@gmail.com>
Date: Tue, 17 Jul 2018 19:12:48 -0500
main: Simplify sim_auth_init
There's no real reason why sim_auth_init should fail, so simplify the
procedure and move declarations to iwd.h
Diffstat:
4 files changed, 7 insertions(+), 17 deletions(-)
diff --git a/src/iwd.h b/src/iwd.h
@@ -34,3 +34,6 @@ void iwd_shutdown(void);
void network_init();
void network_exit();
+
+void sim_auth_init(void);
+void sim_auth_exit(void);
diff --git a/src/main.c b/src/main.c
@@ -409,12 +409,6 @@ int main(int argc, char *argv[])
goto done;
}
- if (!sim_auth_init()) {
- l_error("Failed to start sim auth module");
- exit_status = EXIT_FAILURE;
- goto done;
- }
-
plugin_init(plugins, noplugins);
genl = l_genl_new_default();
@@ -455,10 +449,12 @@ int main(int argc, char *argv[])
network_init();
known_networks_init();
rfkill_init();
+ sim_auth_init();
exit_status = EXIT_SUCCESS;
l_main_run();
+ sim_auth_exit();
rfkill_exit();
known_networks_exit();
network_exit();
@@ -466,7 +462,6 @@ int main(int argc, char *argv[])
eapol_exit();
eap_exit();
plugin_exit();
- sim_auth_exit();
l_genl_family_unref(nl80211);
diff --git a/src/simauth.c b/src/simauth.c
@@ -25,6 +25,7 @@
#include <errno.h>
#include <ell/ell.h>
+#include "iwd.h"
#include "watchlist.h"
#include "simauth.h"
@@ -174,14 +175,9 @@ void sim_auth_cancel_request(struct iwd_sim_auth *auth, int id)
auth->driver->cancel_request(auth, id);
}
-bool sim_auth_init(void)
+void sim_auth_init(void)
{
auth_providers = l_queue_new();
-
- if (!auth_providers)
- return false;
-
- return true;
}
void sim_auth_exit(void)
diff --git a/src/simauth.h b/src/simauth.h
@@ -147,7 +147,3 @@ int sim_auth_run_gsm(struct iwd_sim_auth *auth, const uint8_t *rands,
int num_rands, sim_auth_run_gsm_cb_t cb, void *data);
void sim_auth_cancel_request(struct iwd_sim_auth *auth, int id);
-
-bool sim_auth_init(void);
-
-void sim_auth_exit(void);