summaryrefslogtreecommitdiffstats
path: root/include/osmocom/sim
diff options
context:
space:
mode:
authorStefan Sperling <ssperling@sysmocom.de>2018-02-22 18:16:29 +0100
committerStefan Sperling <ssperling@sysmocom.de>2018-02-23 11:55:54 +0100
commit218c4de84f6d94a882e3a945332f53732bf2e134 (patch)
tree73ffa7542944cc9836149583baab14d8aae80920 /include/osmocom/sim
parent92decf2aa916353564a9dabe6871ab00e0f06a80 (diff)
ensure that osmo_fsm vty commands are only installed once
There is a desire to install osmo_fsm vty commands automatically in a library context, rather than requiring every application which directly or indirectly uses osmo_fsm to run osmo_fsm_vty_add_cmd(). However, the function install_element_ve() asserts that elements about to be installed have not already been installed. This means we cannot shift responsibility into a library context without first making sure that osmo_fsm commands are only installed once per combined application+library context, because applications won't know which commands any of its libraries has already installed. A simple solution is to use a global flag which is checked by osmo_fsm_vty_add_cmd() before installing osmo_fsm commands, and is set once the commands have been installed. This way, no harm is done if osmo_fsm_vty_add_cmd() is called multiple times. Change-Id: I10b0b1c1c1bf44c3b8eafc465c1ee06ea2590682 Related: OS#2967
Diffstat (limited to 'include/osmocom/sim')
0 files changed, 0 insertions, 0 deletions