summaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-bsc_mgcp
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-05-12 16:02:07 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-05-12 16:11:14 +0200
commit67cd75f9fa0e9c2140cbef08a7774760470e32a1 (patch)
tree8f64d246e0f535866f56dccb5e9963ebe8dee77a /openbsc/src/osmo-bsc_mgcp
parent99beb96fc0fdd2073ec7651e68bcea5d89db0737 (diff)
misc: Use the osmo_init code for signals and logging
Use the libosmocore code to ignore certain signals by default (e.g. SIGHUP, SIGPIPE) and use the new code to create a default stderr logging target and initialize it properly.
Diffstat (limited to 'openbsc/src/osmo-bsc_mgcp')
-rw-r--r--openbsc/src/osmo-bsc_mgcp/mgcp_main.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/openbsc/src/osmo-bsc_mgcp/mgcp_main.c b/openbsc/src/osmo-bsc_mgcp/mgcp_main.c
index 8cb90c5..921fa09 100644
--- a/openbsc/src/osmo-bsc_mgcp/mgcp_main.c
+++ b/openbsc/src/osmo-bsc_mgcp/mgcp_main.c
@@ -32,16 +32,19 @@
#include <sys/socket.h>
#include <openbsc/debug.h>
+#include <openbsc/gsm_data.h>
+#include <openbsc/mgcp.h>
+#include <openbsc/mgcp_internal.h>
+#include <openbsc/vty.h>
+
+#include <osmocom/core/application.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/process.h>
-#include <openbsc/gsm_data.h>
#include <osmocom/core/select.h>
-#include <openbsc/mgcp.h>
-#include <openbsc/mgcp_internal.h>
+
#include <osmocom/vty/telnet_interface.h>
#include <osmocom/vty/logging.h>
-#include <openbsc/vty.h>
#include <osmocom/vty/command.h>
@@ -193,14 +196,11 @@ int main(int argc, char **argv)
struct gsm_network dummy_network;
struct sockaddr_in addr;
int on = 1, rc;
- struct log_target *stderr_target;
tall_bsc_ctx = talloc_named_const(NULL, 1, "mgcp-callagent");
- log_init(&log_info);
- stderr_target = log_target_create_stderr();
- log_add_target(stderr_target);
- log_set_all_filter(stderr_target, 1);
+ osmo_init_ignore_signals();
+ osmo_init_logging(&log_info);
cfg = mgcp_config_alloc();
if (!cfg)