aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-02-07 23:29:20 +0100
committerMax Kellermann <max@duempel.org>2014-02-07 23:29:20 +0100
commit4d5ebafa6dd1ed5d40e5e7f6b86aae1d828341cf (patch)
treed38640eb8d60efe716ca56f822c9da87eb52f994 /src
parentec8873b178ae217b5755c6494a97857a3d02bf9e (diff)
downloadmpd-4d5ebafa6dd1ed5d40e5e7f6b86aae1d828341cf.tar.gz
mpd-4d5ebafa6dd1ed5d40e5e7f6b86aae1d828341cf.tar.xz
mpd-4d5ebafa6dd1ed5d40e5e7f6b86aae1d828341cf.zip
Main: check the music directory
Move call from Mapper.cxx.
Diffstat (limited to 'src')
-rw-r--r--src/Main.cxx5
-rw-r--r--src/Mapper.cxx2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/Main.cxx b/src/Main.cxx
index b7f914cdb..7a2789b0c 100644
--- a/src/Main.cxx
+++ b/src/Main.cxx
@@ -46,6 +46,7 @@
#include "fs/AllocatedPath.hxx"
#include "fs/Config.hxx"
#include "fs/StandardDirectory.hxx"
+#include "fs/CheckFile.hxx"
#include "playlist/PlaylistRegistry.hxx"
#include "zeroconf/ZeroconfGlue.hxx"
#include "decoder/DecoderList.hxx"
@@ -145,8 +146,10 @@ glue_mapper_init(Error &error)
if (music_dir.IsNull())
music_dir = GetUserMusicDir();
- if (!music_dir.IsNull())
+ if (!music_dir.IsNull()) {
music_dir.ChopSeparators();
+ CheckDirectoryReadable(music_dir);
+ }
#ifdef ENABLE_DATABASE
if (!music_dir.IsNull()) {
diff --git a/src/Mapper.cxx b/src/Mapper.cxx
index be58b49c9..f97cc3f9c 100644
--- a/src/Mapper.cxx
+++ b/src/Mapper.cxx
@@ -54,8 +54,6 @@ mapper_set_music_dir(AllocatedPath &&path)
assert(!path.IsNull());
music_dir_fs = std::move(path);
-
- CheckDirectoryReadable(music_dir_fs);
}
#endif