fixeria has uploaded this change for review.

View Change

{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

To view, visit change 31914. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I2aa03c7c68b7cca17eebbf858ada7c42f0d0a1da
Gerrit-Change-Number: 31914
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>
Gerrit-MessageType: newchange