diff options
author | Stefan Sperling <ssperling@sysmocom.de> | 2018-02-26 19:17:02 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-02-26 19:00:23 +0000 |
commit | 888dc7d31aa4b39ba8e08884c39be1c09c92f82a (patch) | |
tree | 6e5b8f5aee7ce231d7890ccc1d663489cb780115 /src | |
parent | 6950b191e84c73687f9dc77462ff66cbeaec5686 (diff) |
print BIG FAT ERROR message if osmo_fsm lacks event names
Event names are displayed in VTY commands so all FSM should have them.
Print an error message if an FSM is registered without event names.
We could also return an error code, however at present no caller checks
the return value of osmo_fsm_register() so this would be pointless.
Add event names to the test FSM and update expected output accordingly.
Change-Id: I08b100d62b5c50bf025ef87d31ea39072539cf37
Related: OS#3008
Diffstat (limited to 'src')
-rw-r--r-- | src/fsm.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -154,6 +154,8 @@ int osmo_fsm_register(struct osmo_fsm *fsm) } if (osmo_fsm_find_by_name(fsm->name)) return -EEXIST; + if (fsm->event_names == NULL) + LOGP(DLGLOBAL, LOGL_ERROR, "FSM '%s' has no event names! Please fix!\n", fsm->name); llist_add_tail(&fsm->list, &osmo_g_fsms); INIT_LLIST_HEAD(&fsm->instances); |