fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/31914 )
Change subject: {context,select}: cosmetic: use OTC_SELECT instead of osmo_ctx->select ......................................................................
{context,select}: cosmetic: use OTC_SELECT instead of osmo_ctx->select
Change-Id: I2aa03c7c68b7cca17eebbf858ada7c42f0d0a1da --- M src/core/context.c M src/core/select.c 2 files changed, 15 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/14/31914/1
diff --git a/src/core/context.c b/src/core/context.c index 6b58565..125c992 100644 --- a/src/core/context.c +++ b/src/core/context.c @@ -30,8 +30,8 @@ return -ENOMEM; memset(osmo_ctx, 0, sizeof(*osmo_ctx)); osmo_ctx->global = osmo_ctx; - osmo_ctx->select = talloc_named_const(osmo_ctx->global, 0, "select"); - if (!osmo_ctx->select) { + osmo_ctx->select = talloc_named_const(OTC_SELECT, 0, "select"); + if (!OTC_SELECT) { talloc_free(osmo_ctx); return -ENOMEM; } diff --git a/src/core/select.c b/src/core/select.c index c60cd8e..76e9e97 100644 --- a/src/core/select.c +++ b/src/core/select.c @@ -451,7 +451,7 @@ if (!_osmo_select_shutdown_requested) osmo_timers_update();
- OSMO_ASSERT(osmo_ctx->select); + OSMO_ASSERT(OTC_SELECT);
/* call registered callback functions */ return poll_disp_fds(n_poll); @@ -480,7 +480,7 @@ /* fire timers */ osmo_timers_update();
- OSMO_ASSERT(osmo_ctx->select); + OSMO_ASSERT(OTC_SELECT);
/* call registered callback functions */ return osmo_fd_disp_fds(&readset, &writeset, &exceptset); @@ -495,7 +495,7 @@ { int rc = _osmo_select_main(polling); #ifndef EMBEDDED - if (talloc_total_size(osmo_ctx->select) != 0) { + if (talloc_total_size(OTC_SELECT) != 0) { osmo_panic("You cannot use the 'select' volatile " "context if you don't use osmo_select_main_ctx()!\n"); } @@ -512,7 +512,7 @@ { int rc = _osmo_select_main(polling); /* free all the children of the volatile 'select' scope context */ - talloc_free_children(osmo_ctx->select); + talloc_free_children(OTC_SELECT); return rc; } #endif