From f4a5bd2dd25291a5ff036d6273731c6147736a5e Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sat, 14 Apr 2012 14:36:23 +0200 Subject: sysmobts: Handle options before allocating the bts This way -h/--version will always work, even when the underlying hardware is not available. --- src/osmo-bts-sysmo/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/osmo-bts-sysmo/main.c') diff --git a/src/osmo-bts-sysmo/main.c b/src/osmo-bts-sysmo/main.c index c68271e0..747c50dd 100644 --- a/src/osmo-bts-sysmo/main.c +++ b/src/osmo-bts-sysmo/main.c @@ -103,7 +103,7 @@ static void print_help() " -T --timestamp Prefix every log line with a timestamp\n" " -V --version Print version information and exit\n" " -e --log-level Set a global log-level\n" - " -p --dsp-trace Set DSP trace flags\n" + " -p --dsp-trace Set DSP trace flags\n" ); } @@ -204,6 +204,8 @@ int main(int argc, char **argv) vty_init(&bts_vty_info); bts_vty_init(&bts_log_info); + handle_options(argc, argv); + bts = gsm_bts_alloc(tall_bts_ctx); if (bts_init(bts) < 0) { fprintf(stderr, "unable to to open bts\n"); @@ -212,7 +214,6 @@ int main(int argc, char **argv) btsb = bts_role_bts(bts); btsb->support.ciphers = (1 << 0) | (1 << 1) | (1 << 2); - handle_options(argc, argv); rc = vty_read_config_file(config_file, NULL); if (rc < 0) { -- cgit v1.2.3