Change in libosmocore[master]: fsm: guard action callback

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/.

dexter gerrit-no-reply at lists.osmocom.org
Tue May 15 09:53:58 UTC 2018


dexter has uploaded this change for review. ( https://gerrit.osmocom.org/9160


Change subject: fsm: guard action callback
......................................................................

fsm: guard action callback

The FSM allows to set individual action callback functions for each
state but it does not allow to leave the action callback pointer
unpopulated. However, there are cornercases where having no callback
function is desirable.

- Check if action callback is popolated before executing it.

Change-Id: I36d221c973d3890721ef1d376fb9be82c4311378
---
M src/fsm.c
1 file changed, 3 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/60/9160/1

diff --git a/src/fsm.c b/src/fsm.c
index ae2fdc2..0370f65 100644
--- a/src/fsm.c
+++ b/src/fsm.c
@@ -541,7 +541,9 @@
 			    osmo_fsm_event_name(fsm, event));
 		return -1;
 	}
-	fs->action(fi, event, data);
+
+	if (fs->action)
+		fs->action(fi, event, data);
 
 	return 0;
 }

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I36d221c973d3890721ef1d376fb9be82c4311378
Gerrit-Change-Number: 9160
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180515/9f76f077/attachment.htm>


More information about the gerrit-log mailing list