Change in ...libosmocore[master]: osmo_tdef_get(): allow passing -1 as default timeout

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

neels gerrit-no-reply at lists.osmocom.org
Thu Aug 15 01:03:08 UTC 2019


neels has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/libosmocore/+/15218 )

Change subject: osmo_tdef_get(): allow passing -1 as default timeout
......................................................................

osmo_tdef_get(): allow passing -1 as default timeout

The intention of osmo_tdef_get()'s val_if_not_present argument was to return a
default timeout, or to optionally abort the program for missing timer
definitions if the default timeout is < 0. This was the case in the original
implementation of this API in osmo-bsc, but in the migration to libosmocore,
the argument was by accident changed to an unsigned type. In consequence, the
assertion in the implementation that was intended to abort the program seemed
bogus to coverity, and was fixed by removal in
I7a544d2d43b83135def296674f777e48fe5fd80a -- the wrong direction, as is obvious
from the API doc for osmo_tdef_get().

Note that osmo-bsc master passes -1 in various places and expects the
program-abort behavior that was missing from the libosmocore implementation.

Change the val_if_not_present argument to a signed type, and revert removal of
the assertion, so that passing -1 has the effect described in the API doc:
program abort on missing timer definition.

This bug was not detected because it is hard to write tests that expect a
program abort to happen, hence no tests for this API feature exist.

Related: OS#4152
Change-Id: Ie61c3c85069916336e6dbd91a2c16f7634816417
---
M TODO-RELEASE
M include/osmocom/core/tdef.h
M src/tdef.c
3 files changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/18/15218/2
-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/15218
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ie61c3c85069916336e6dbd91a2c16f7634816417
Gerrit-Change-Number: 15218
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newpatchset
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190815/dc81b026/attachment.htm>


More information about the gerrit-log mailing list