All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Allow override of phonesim conf
@ 2014-03-26 11:26 Jussi Pakkanen
  2014-03-26 15:49 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Jussi Pakkanen @ 2014-03-26 11:26 UTC (permalink / raw)
  To: ofono

[-- 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;
 }

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-26 15:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-26 11:26 [PATCH] Allow override of phonesim conf Jussi Pakkanen
2014-03-26 15:49 ` Denis Kenzior

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.