aboutsummaryrefslogtreecommitdiffstats
path: root/src/UpdateWalk.cxx
diff options
context:
space:
mode:
authorDenis Krjuchkov <denis@crazydev.net>2013-02-02 20:23:57 +0600
committerDenis Krjuchkov <denis@crazydev.net>2013-02-02 20:51:36 +0600
commitd818b618af8b50d5a04a47cc0032c8f8c5d2bb02 (patch)
tree0986f690f5916ad6caf29cd837255c1ee95c80cd /src/UpdateWalk.cxx
parentc64700e7ae8f52bbf2c0e8a3673f587155719a07 (diff)
downloadmpd-d818b618af8b50d5a04a47cc0032c8f8c5d2bb02.tar.gz
mpd-d818b618af8b50d5a04a47cc0032c8f8c5d2bb02.tar.xz
mpd-d818b618af8b50d5a04a47cc0032c8f8c5d2bb02.zip
UpdateWalk.cxx: use FileExists
Diffstat (limited to '')
-rw-r--r--src/UpdateWalk.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/UpdateWalk.cxx b/src/UpdateWalk.cxx
index 322a8fce2..9a2e87d56 100644
--- a/src/UpdateWalk.cxx
+++ b/src/UpdateWalk.cxx
@@ -33,6 +33,7 @@
#include "ExcludeList.hxx"
#include "conf.h"
#include "fs/Path.hxx"
+#include "fs/FileSystem.hxx"
extern "C" {
#include "uri.h"
@@ -141,10 +142,8 @@ purge_deleted_from_directory(Directory *directory)
struct song *song, *ns;
directory_for_each_song_safe(song, ns, directory) {
- struct stat st;
const Path path = map_song_fs(song);
- if (path.IsNull() ||
- stat(path.c_str(), &st) < 0 || !S_ISREG(st.st_mode)) {
+ if (path.IsNull() || !FileExists(path)) {
db_lock();
delete_song(directory, song);
db_unlock();