Change in osmocom-bb[master]: common/sap_fsm.c: register SAP FSM on DSO load

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Sun Feb 3 09:26:37 UTC 2019


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 <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190203/cd09143b/attachment.htm>


More information about the gerrit-log mailing list