Main: use getExternalStorageDirectory() for locating mpd.conf
This commit is contained in:
parent
477877406a
commit
8cf3ac200b
11
src/Main.cxx
11
src/Main.cxx
@ -430,8 +430,17 @@ int mpd_main(int argc, char *argv[])
|
|||||||
(void)argc;
|
(void)argc;
|
||||||
(void)argv;
|
(void)argv;
|
||||||
|
|
||||||
if (!ReadConfigFile(Path::FromFS("/sdcard/mpd.conf"), 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);
|
LogError(error);
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
if (!parse_cmdline(argc, argv, &options, error)) {
|
if (!parse_cmdline(argc, argv, &options, error)) {
|
||||||
LogError(error);
|
LogError(error);
|
||||||
|
Loading…
Reference in New Issue
Block a user