<p>Harald Welte has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/14361">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">fsm.c: Print error message for FSM with allstate_action but no events<br><br>As suggested by Vadim while reviewing a related fix for ipa_keepalive.c<br>in libosmo-abis (see https://gerrit.osmocom.org/#/c/libosmo-abis/+/13540/),<br>it makes sense to print an error message if anyone registers a FSM<br>that specifies an allstate_action callback but at the same time no<br>events that would ever end up in that callback.<br><br>Change-Id: I9e73f7363ab15a00843e3f0d1e5776f4be7ebc46<br>---<br>M src/fsm.c<br>1 file changed, 3 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/61/14361/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/fsm.c b/src/fsm.c</span><br><span>index 411797d..ac9e055 100644</span><br><span>--- a/src/fsm.c</span><br><span>+++ b/src/fsm.c</span><br><span>@@ -256,6 +256,9 @@</span><br><span>               return -EEXIST;</span><br><span>      if (fsm->event_names == NULL)</span><br><span>             LOGP(DLGLOBAL, LOGL_ERROR, "FSM '%s' has no event names! Please fix!\n", fsm->name);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   if (fsm->allstate_action && !fsm->allstate_event_mask)</span><br><span style="color: hsl(120, 100%, 40%);">+          LOGP(DLGLOBAL, LOGL_ERROR, "FSM '%s' has allstate_action but no allstate_event_mask\n",fsm->name);</span><br><span>      llist_add_tail(&fsm->list, &osmo_g_fsms);</span><br><span>         INIT_LLIST_HEAD(&fsm->instances);</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/14361">change 14361</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/libosmocore/+/14361"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I9e73f7363ab15a00843e3f0d1e5776f4be7ebc46 </div>
<div style="display:none"> Gerrit-Change-Number: 14361 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>