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/.
Harald Welte gerrit-no-reply at lists.osmocom.orgHarald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10481 )
Change subject: signal: Introduce API osmo_signal_talloc_ctx_init
......................................................................
signal: Introduce API osmo_signal_talloc_ctx_init
Otherwise applications need to use "extern void* tall_sigh_ctx" and set
it manually (that symbol is not exported in any header file) or end up
allocating struct signal_handler into the NULL talloc ctx.
API created in a similar way as already existing msgb_talloc_ctx_init(),
but without the pool_size because it's not considered necessary in this
case.
Change-Id: Id58ca18eb826b8f4183a7cf0dbb2b38cba702a09
---
M include/osmocom/core/signal.h
M src/signal.c
2 files changed, 10 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
Vadim Yanitskiy: Looks good to me, but someone else must approve
Harald Welte: Looks good to me, approved
diff --git a/include/osmocom/core/signal.h b/include/osmocom/core/signal.h
index ae78f15..449b976 100644
--- a/include/osmocom/core/signal.h
+++ b/include/osmocom/core/signal.h
@@ -34,6 +34,7 @@
/* Management */
+void *osmo_signal_talloc_ctx_init(void *root_ctx);
int osmo_signal_register_handler(unsigned int subsys, osmo_signal_cbfn *cbfn, void *data);
void osmo_signal_unregister_handler(unsigned int subsys, osmo_signal_cbfn *cbfn, void *data);
diff --git a/src/signal.c b/src/signal.c
index 745d7c3..188876b 100644
--- a/src/signal.c
+++ b/src/signal.c
@@ -46,6 +46,15 @@
void *data;
};
+/*! Initialize a signal_handler talloc context for \ref osmo_signal_register_handler.
+ * Create a talloc context called "osmo_signal".
+ * \param[in] root_ctx talloc context used as parent for the new "osmo_signal" ctx.
+ * \returns the new osmo_signal talloc context, e.g. for reporting
+ */
+void *osmo_signal_talloc_ctx_init(void *root_ctx) {
+ tall_sigh_ctx = talloc_named_const(tall_sigh_ctx, 0, "osmo_signal");
+ return tall_sigh_ctx;
+}
/*! Register a new signal handler
* \param[in] subsys Subsystem number
--
To view, visit https://gerrit.osmocom.org/10481
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Id58ca18eb826b8f4183a7cf0dbb2b38cba702a09
Gerrit-Change-Number: 10481
Gerrit-PatchSet: 2
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180817/c3428a7f/attachment.htm>