<p>neels <strong>uploaded patch set #2</strong> to this change.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/15218">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">osmo_tdef_get(): allow passing -1 as default timeout<br><br>The intention of osmo_tdef_get()'s val_if_not_present argument was to return a<br>default timeout, or to optionally abort the program for missing timer<br>definitions if the default timeout is < 0. This was the case in the original<br>implementation of this API in osmo-bsc, but in the migration to libosmocore,<br>the argument was by accident changed to an unsigned type. In consequence, the<br>assertion in the implementation that was intended to abort the program seemed<br>bogus to coverity, and was fixed by removal in<br>I7a544d2d43b83135def296674f777e48fe5fd80a -- the wrong direction, as is obvious<br>from the API doc for osmo_tdef_get().<br><br>Note that osmo-bsc master passes -1 in various places and expects the<br>program-abort behavior that was missing from the libosmocore implementation.<br><br>Change the val_if_not_present argument to a signed type, and revert removal of<br>the assertion, so that passing -1 has the effect described in the API doc:<br>program abort on missing timer definition.<br><br>This bug was not detected because it is hard to write tests that expect a<br>program abort to happen, hence no tests for this API feature exist.<br><br>Related: OS#4152<br>Change-Id: Ie61c3c85069916336e6dbd91a2c16f7634816417<br>---<br>M TODO-RELEASE<br>M include/osmocom/core/tdef.h<br>M src/tdef.c<br>3 files changed, 4 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/18/15218/2</pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/15218">change 15218</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/+/15218"/><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: Ie61c3c85069916336e6dbd91a2c16f7634816417 </div>
<div style="display:none"> Gerrit-Change-Number: 15218 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>