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
This commit is contained in:
Denis Kenzior 2018-07-17 19:12:48 -05:00
parent 8cf44499d1
commit 6b58ab1a08
4 changed files with 7 additions and 17 deletions

View File

@ -34,3 +34,6 @@ void iwd_shutdown(void);
void network_init();
void network_exit();
void sim_auth_init(void);
void sim_auth_exit(void);

View File

@ -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);

View File

@ -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)

View File

@ -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);