move osmo_fsm_register() into constructor function
This way each application doesn't have to explicitly call it. Change-Id: I20753d7f7f485e7e495b64fa74b24858cd22ffa9
This commit is contained in:
parent
3ac66a1bb7
commit
7fc64bc5b2
|
@ -88,9 +88,6 @@ int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
g_tall_ctx = talloc_named_const(NULL, 0, "global");
|
g_tall_ctx = talloc_named_const(NULL, 0, "global");
|
||||||
|
|
||||||
osmo_fsm_register(&remsim_client_bankd_fsm);
|
|
||||||
osmo_fsm_register(&remsim_client_server_fsm);
|
|
||||||
|
|
||||||
g_client = talloc_zero(g_tall_ctx, struct bankd_client);
|
g_client = talloc_zero(g_tall_ctx, struct bankd_client);
|
||||||
g_client->bankd_host = "localhost";
|
g_client->bankd_host = "localhost";
|
||||||
g_client->bankd_port = 9999;
|
g_client->bankd_port = 9999;
|
||||||
|
|
|
@ -464,3 +464,9 @@ int server_conn_fsm_alloc(void *ctx, struct rspro_server_conn *srvc)
|
||||||
srvc_st_init_onenter(fi, 0);
|
srvc_st_init_onenter(fi, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static __attribute__((constructor)) void on_dso_load(void)
|
||||||
|
{
|
||||||
|
osmo_fsm_register(&remsim_client_bankd_fsm);
|
||||||
|
osmo_fsm_register(&remsim_client_server_fsm);
|
||||||
|
}
|
||||||
|
|
|
@ -749,9 +749,6 @@ int main(int argc, char **argv)
|
||||||
// initialize remote SIM client
|
// initialize remote SIM client
|
||||||
g_tall_ctx = talloc_named_const(NULL, 0, "global");
|
g_tall_ctx = talloc_named_const(NULL, 0, "global");
|
||||||
|
|
||||||
osmo_fsm_register(&remsim_client_bankd_fsm);
|
|
||||||
osmo_fsm_register(&remsim_client_server_fsm);
|
|
||||||
|
|
||||||
g_client = talloc_zero(g_tall_ctx, struct bankd_client);
|
g_client = talloc_zero(g_tall_ctx, struct bankd_client);
|
||||||
g_client->bankd_host = bankd_host;
|
g_client->bankd_host = bankd_host;
|
||||||
g_client->bankd_port = bankd_port;
|
g_client->bankd_port = bankd_port;
|
||||||
|
|
Loading…
Reference in New Issue