From: Jussi Pakkanen <jussi.pakkanen@canonical.com>
To: ofono@ofono.org
Subject: [PATCH] Allow override of phonesim conf
Date: Wed, 26 Mar 2014 13:26:49 +0200 [thread overview]
Message-ID: <5332B979.1010604@canonical.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 314 bytes --]
Hi
Currently phonesim tries to open its conf file from the location
specified at configure time (/etc/ofono/phonesim.conf). For testing
purposes it would be nice to be able to override this. This patch allows
you to override the location with the environment variable
OFONO_PHONESIM_CONFIG.
Thanks,
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: config_override.patch --]
[-- Type: text/x-patch, Size: 679 bytes --]
diff --git a/plugins/phonesim.c b/plugins/phonesim.c
index 918d2eb..991aaea 100644
--- a/plugins/phonesim.c
+++ b/plugins/phonesim.c
@@ -1071,7 +1071,7 @@ done:
static int phonesim_init(void)
{
int err;
-
+ char *conf_override = getenv("OFONO_PHONESIM_CONFIG");
err = ofono_modem_driver_register(&phonesim_driver);
if (err < 0)
return err;
@@ -1081,7 +1081,11 @@ static int phonesim_init(void)
ofono_gprs_context_driver_register(&context_driver);
ofono_ctm_driver_register(&ctm_driver);
- parse_config(CONFIGDIR "/phonesim.conf");
+ if(conf_override) {
+ parse_config(conf_override);
+ } else {
+ parse_config(CONFIGDIR "/phonesim.conf");
+ }
return 0;
}
next reply other threads:[~2014-03-26 11:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-26 11:26 Jussi Pakkanen [this message]
2014-03-26 15:49 ` [PATCH] Allow override of phonesim conf Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5332B979.1010604@canonical.com \
--to=jussi.pakkanen@canonical.com \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.