diff options
-rw-r--r-- | src/host/trxcon/l1ctl_link.c | 6 | ||||
-rw-r--r-- | src/host/trxcon/trx_if.c | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/host/trxcon/l1ctl_link.c b/src/host/trxcon/l1ctl_link.c index 20cb70ce..23019fda 100644 --- a/src/host/trxcon/l1ctl_link.c +++ b/src/host/trxcon/l1ctl_link.c @@ -269,7 +269,6 @@ int l1ctl_link_init(struct l1ctl_link **l1l, const char *sock_path) l1l_new->wq.bfd.fd = -1; /* Allocate a new dedicated state machine */ - osmo_fsm_register(&l1ctl_fsm); l1l_new->fsm = osmo_fsm_inst_alloc(&l1ctl_fsm, l1l_new, NULL, LOGL_DEBUG, "l1ctl_link"); @@ -308,3 +307,8 @@ void l1ctl_link_shutdown(struct l1ctl_link *l1l) osmo_fsm_inst_free(l1l->fsm); talloc_free(l1l); } + +static __attribute__((constructor)) void on_dso_load(void) +{ + OSMO_ASSERT(osmo_fsm_register(&l1ctl_fsm) == 0); +} diff --git a/src/host/trxcon/trx_if.c b/src/host/trxcon/trx_if.c index 982fb40d..91b87a2a 100644 --- a/src/host/trxcon/trx_if.c +++ b/src/host/trxcon/trx_if.c @@ -660,7 +660,6 @@ int trx_if_open(struct trx_instance **trx, const char *local_host, goto error; /* Allocate a new dedicated state machine */ - osmo_fsm_register(&trx_fsm); trx_new->fsm = osmo_fsm_inst_alloc(&trx_fsm, trx_new, NULL, LOGL_DEBUG, "trx_interface"); @@ -710,3 +709,8 @@ void trx_if_close(struct trx_instance *trx) osmo_fsm_inst_free(trx->fsm); talloc_free(trx); } + +static __attribute__((constructor)) void on_dso_load(void) +{ + OSMO_ASSERT(osmo_fsm_register(&trx_fsm) == 0); +} |