aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-sysmo
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-04-01 16:11:39 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2018-04-04 17:54:37 +0200
commit113e30cb0639cefbafdad2862c5e69b0e17d9bf3 (patch)
tree753dbe0cc7a4e7fd09cb44e9da2db7be401916f7 /src/osmo-bts-sysmo
parent091fcf147ae83d8daec92b2506d14e5e5ad35f80 (diff)
use osmo_init_logging2() with proper talloc ctx
Completely drop bts_log_init(), call osmo_init_logging2() directly instead: all callers of bts_log_init() passed NULL as category string, so all it ever did was call osmo_init_logging(). The bts_log_info is already declared in the .h. Here and there also define a proper talloc root context instead of using NULL. Change-Id: Ic049f77bef74123b95350bcae182a468e0086b9c
Diffstat (limited to 'src/osmo-bts-sysmo')
-rw-r--r--src/osmo-bts-sysmo/l1_fwd_main.c8
-rw-r--r--src/osmo-bts-sysmo/misc/sysmobts_mgr.c8
2 files changed, 6 insertions, 10 deletions
diff --git a/src/osmo-bts-sysmo/l1_fwd_main.c b/src/osmo-bts-sysmo/l1_fwd_main.c
index 92d2ea47..bc9fc21c 100644
--- a/src/osmo-bts-sysmo/l1_fwd_main.c
+++ b/src/osmo-bts-sysmo/l1_fwd_main.c
@@ -37,6 +37,7 @@
#include <osmocom/core/write_queue.h>
#include <osmocom/core/logging.h>
#include <osmocom/core/socket.h>
+#include <osmocom/core/application.h>
#include <osmocom/gsm/gsm_utils.h>
#include <osmo-bts/logging.h>
@@ -169,11 +170,12 @@ int main(int argc, char **argv)
struct l1fwd_hdl *l1fh;
struct femtol1_hdl *fl1h;
int rc, i;
+ void *ctx = talloc_named_const(NULL, 0, "l1_fwd");
printf("sizeof(GsmL1_Prim_t) = %zu\n", sizeof(GsmL1_Prim_t));
printf("sizeof(SuperFemto_Prim_t) = %zu\n", sizeof(SuperFemto_Prim_t));
- bts_log_init(NULL);
+ osmo_init_logging2(ctx, &bts_log_info);
/*
* hack and prevent that two l1fwd-proxy/sysmobts run at the same
@@ -187,7 +189,7 @@ int main(int argc, char **argv)
}
/* allocate new femtol1_handle */
- fl1h = talloc_zero(NULL, struct femtol1_hdl);
+ fl1h = talloc_zero(ctx, struct femtol1_hdl);
INIT_LLIST_HEAD(&fl1h->wlc_list);
/* open the actual hardware transport */
@@ -198,7 +200,7 @@ int main(int argc, char **argv)
}
/* create our fwd handle */
- l1fh = talloc_zero(NULL, struct l1fwd_hdl);
+ l1fh = talloc_zero(ctx, struct l1fwd_hdl);
l1fh->fl1h = fl1h;
fl1h->priv = l1fh;
diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr.c b/src/osmo-bts-sysmo/misc/sysmobts_mgr.c
index 17a6d89b..a0080738 100644
--- a/src/osmo-bts-sysmo/misc/sysmobts_mgr.c
+++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr.c
@@ -245,12 +245,6 @@ static const struct log_info mgr_log_info = {
.num_cat = ARRAY_SIZE(mgr_log_info_cat),
};
-static int mgr_log_init(void)
-{
- osmo_init_logging(&mgr_log_info);
- return 0;
-}
-
int main(int argc, char **argv)
{
int rc;
@@ -261,7 +255,7 @@ int main(int argc, char **argv)
srand(time(NULL));
- mgr_log_init();
+ osmo_init_logging2(tall_mgr_ctx, &mgr_log_info);
if (classify_bts() != 0)
exit(2);