aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-03-02 00:24:31 +0100
committerMax Kellermann <max@duempel.org>2014-03-02 00:24:31 +0100
commit8cf3ac200b10cbab449b723d8b0f93cf94d479cf (patch)
tree2ed9d1cd17d451c4f23668a3d0de9e5ba234d653
parent477877406a09eef1f71cea834bd62ea5610bc61f (diff)
downloadmpd-8cf3ac200b10cbab449b723d8b0f93cf94d479cf.tar.gz
mpd-8cf3ac200b10cbab449b723d8b0f93cf94d479cf.tar.xz
mpd-8cf3ac200b10cbab449b723d8b0f93cf94d479cf.zip
Main: use getExternalStorageDirectory() for locating mpd.conf
-rw-r--r--src/Main.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/Main.cxx b/src/Main.cxx
index 165e53fd7..3a6346385 100644
--- a/src/Main.cxx
+++ b/src/Main.cxx
@@ -430,8 +430,17 @@ int mpd_main(int argc, char *argv[])
(void)argc;
(void)argv;
- if (!ReadConfigFile(Path::FromFS("/sdcard/mpd.conf"), error))
- LogError(error);
+ {
+ const auto sdcard = Environment::getExternalStorageDirectory();
+ if (!sdcard.IsNull()) {
+ const auto config_path =
+ AllocatedPath::Build(sdcard, "mpd.conf");
+ if (!ReadConfigFile(config_path, error)) {
+ LogError(error);
+ return EXIT_FAILURE;
+ }
+ }
+ }
#else
if (!parse_cmdline(argc, argv, &options, error)) {
LogError(error);