diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-10-05 19:23:27 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-10-07 14:08:22 +0200 |
commit | 40c7410f9eb6961d5288c4bbf9072832b2b09ea1 (patch) | |
tree | 3d72a7d4946b4edb80823e4b4575e7925c86f3f6 /src | |
parent | 12adbeaba35032bc81647e6ccbd6bfdbe4cdf248 (diff) |
Move ts_fsm_init to static constructor [3/4]
This allows having it initialized automatically, as we usually do with
this type of code. As a result, tests or other apps importing libbsc
don't need to take care of calling it.
NOTE: This fix is required by follow-up patches where some stubs are removed
and hence some tests start using FSMs internally. Since tests were not
using those FSMs before, there was no need to call ts_fsm_init().
This is one further step towards fixing interdependency mess of symbols
and stubs.
Change-Id: I0e4b95b5e73fbb3844d83ba33e66786831088e1f
Diffstat (limited to 'src')
-rw-r--r-- | src/osmo-bsc/osmo_bsc_main.c | 1 | ||||
-rw-r--r-- | src/osmo-bsc/timeslot_fsm.c | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 8d6901d66..e8a22fec2 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -979,7 +979,6 @@ int main(int argc, char **argv) /* seed the PRNG */ srand(time(NULL)); - ts_fsm_init(); lchan_fsm_init(); bsc_subscr_conn_fsm_init(); assignment_fsm_init(); diff --git a/src/osmo-bsc/timeslot_fsm.c b/src/osmo-bsc/timeslot_fsm.c index 8d256bb4e..76ac1af44 100644 --- a/src/osmo-bsc/timeslot_fsm.c +++ b/src/osmo-bsc/timeslot_fsm.c @@ -52,7 +52,7 @@ static void ts_fsm_update_id(struct gsm_bts_trx_ts *ts) gsm_pchan_id(ts->pchan_on_init)); } -void ts_fsm_init() +static __attribute__((constructor)) void ts_fsm_init(void) { OSMO_ASSERT(osmo_fsm_register(&ts_fsm) == 0); } |