aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gsm_subscriber.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2009-07-28 00:44:49 +0200
committerHarald Welte <laforge@gnumonks.org>2009-07-28 00:44:49 +0200
commit3366a94d6c3cd28c71bf76133a3ead3212fd04f1 (patch)
tree6423887a7c52271cce815c8864b51791a4e32410 /openbsc/src/gsm_subscriber.c
parentf3efc597d162e6e5f80e926c992dafe4e9f7dfc6 (diff)
parent7bfc26749662e3a3227037cce4a24748343b50be (diff)
Merge branch 'master' into sms
Conflicts: openbsc/include/openbsc/transaction.h openbsc/src/gsm_04_11.c openbsc/src/transaction.c
Diffstat (limited to 'openbsc/src/gsm_subscriber.c')
-rw-r--r--openbsc/src/gsm_subscriber.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/openbsc/src/gsm_subscriber.c b/openbsc/src/gsm_subscriber.c
index 60dec432..0bcbdf40 100644
--- a/openbsc/src/gsm_subscriber.c
+++ b/openbsc/src/gsm_subscriber.c
@@ -103,10 +103,6 @@ struct gsm_subscriber *subscr_alloc(void)
{
struct gsm_subscriber *s;
- if (!tall_subscr_ctx)
- tall_subscr_ctx = talloc_named_const(tall_bsc_ctx, 1,
- "subscriber");
-
s = talloc(tall_subscr_ctx, struct gsm_subscriber);
if (!s)
return NULL;
@@ -212,10 +208,6 @@ void subscr_get_channel(struct gsm_subscriber *subscr,
{
struct subscr_request *request;
- if (!tall_sub_req_ctx)
- tall_sub_req_ctx = talloc_named_const(tall_bsc_ctx, 1,
- "subscr_request");
-
request = talloc(tall_sub_req_ctx, struct subscr_request);
if (!request) {
if (cbfn)
@@ -272,3 +264,11 @@ void subscr_put_channel(struct gsm_lchan *lchan)
subscr_send_paging_request(lchan->subscr);
}
+
+static __attribute__((constructor)) void on_dso_load_subscr(void)
+{
+ tall_subscr_ctx = talloc_named_const(tall_bsc_ctx, 1, "subscriber");
+
+ tall_sub_req_ctx = talloc_named_const(tall_bsc_ctx, 1,
+ "subscr_request");
+}