diff options
author | Harald Welte <laforge@gnumonks.org> | 2011-03-02 10:35:04 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2011-03-02 10:35:39 +0100 |
commit | 4be57b9afd0f7a07361a5ac24a271adfd5e302d1 (patch) | |
tree | f7895453fcdb5a04a3f54caa34e22440da90739d /src/host/layer23/src/mobile/app_mobile.c | |
parent | b7a4d8d9128076d83bd70157299ef0a7a8717a0c (diff) |
mobile: Use config file in ~/.osmocom/bb/mobile.cfg
We don't need root permission and a system-wide config file in /etc/osmocom
Based on a patch by Pierre Pronchery <khorben@defora.org>
Diffstat (limited to 'src/host/layer23/src/mobile/app_mobile.c')
-rw-r--r-- | src/host/layer23/src/mobile/app_mobile.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/host/layer23/src/mobile/app_mobile.c b/src/host/layer23/src/mobile/app_mobile.c index 1bedb552..a1b47310 100644 --- a/src/host/layer23/src/mobile/app_mobile.c +++ b/src/host/layer23/src/mobile/app_mobile.c @@ -349,7 +349,7 @@ int l23_app_init(int (*mncc_recv)(struct osmocom_ms *ms, int, void *), const char *config_file, uint16_t vty_port) { struct telnet_connection dummy_conn; - int rc; + int rc = 0; mncc_recv_app = mncc_recv; @@ -359,13 +359,15 @@ int l23_app_init(int (*mncc_recv)(struct osmocom_ms *ms, int, void *), ms_vty_init(); dummy_conn.priv = NULL; vty_reading = 1; - rc = vty_read_config_file(config_file, &dummy_conn); - if (rc < 0) { - fprintf(stderr, "Failed to parse the config file: '%s'\n", - config_file); - fprintf(stderr, "Please check or create config file using: " - "'touch %s'\n", config_file); - return rc; + if (config_file != NULL) { + rc = vty_read_config_file(config_file, &dummy_conn); + if (rc < 0) { + fprintf(stderr, "Failed to parse the config file:" + " '%s'\n", config_file); + fprintf(stderr, "Please check or create config file" + " using: 'touch %s'\n", config_file); + return rc; + } } vty_reading = 0; telnet_init(l23_ctx, NULL, vty_port); |