Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/12783


Change subject: common/sap_fsm.c: register SAP FSM on DSO load
......................................................................

common/sap_fsm.c: register SAP FSM on DSO load

Change-Id: Id539c2a3477526b816918070bab93b26c900998a
---
M src/host/layer23/src/common/sap_fsm.c
1 file changed, 5 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/83/12783/1

diff --git a/src/host/layer23/src/common/sap_fsm.c 
b/src/host/layer23/src/common/sap_fsm.c
index 9591dab..f07488f 100644
--- a/src/host/layer23/src/common/sap_fsm.c
+++ b/src/host/layer23/src/common/sap_fsm.c
@@ -674,10 +674,6 @@
        sap = &ms->sap_entity;
        OSMO_ASSERT(sap->fi == NULL);

-       /* Register our FSM (if required) */
-       if (!osmo_fsm_find_by_name(sap_fsm_def.name))
-               OSMO_ASSERT(osmo_fsm_register(&sap_fsm_def) == 0);
-
        /* Allocate an instance using ms as talloc context */
        sap->fi = osmo_fsm_inst_alloc(&sap_fsm_def, ms,
                ms, LOGL_DEBUG, ms->name);
@@ -688,3 +684,8 @@

        return 0;
 }
+
+static __attribute__((constructor)) void on_dso_load(void)
+{
+       OSMO_ASSERT(osmo_fsm_register(&sap_fsm_def) == 0);
+}

--
To view, visit https://gerrit.osmocom.org/12783
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id539c2a3477526b816918070bab93b26c900998a
Gerrit-Change-Number: 12783
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilira...@gmail.com>

Reply via email to