Commit d818b618 authored by Denis Krjuchkov's avatar Denis Krjuchkov

UpdateWalk.cxx: use FileExists

parent c64700e7
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment