UpdateWalk.cxx: use FileExists
This commit is contained in:
parent
c64700e7ae
commit
d818b618af
@ -33,6 +33,7 @@
|
|||||||
#include "ExcludeList.hxx"
|
#include "ExcludeList.hxx"
|
||||||
#include "conf.h"
|
#include "conf.h"
|
||||||
#include "fs/Path.hxx"
|
#include "fs/Path.hxx"
|
||||||
|
#include "fs/FileSystem.hxx"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "uri.h"
|
#include "uri.h"
|
||||||
@ -141,10 +142,8 @@ purge_deleted_from_directory(Directory *directory)
|
|||||||
|
|
||||||
struct song *song, *ns;
|
struct song *song, *ns;
|
||||||
directory_for_each_song_safe(song, ns, directory) {
|
directory_for_each_song_safe(song, ns, directory) {
|
||||||
struct stat st;
|
|
||||||
const Path path = map_song_fs(song);
|
const Path path = map_song_fs(song);
|
||||||
if (path.IsNull() ||
|
if (path.IsNull() || !FileExists(path)) {
|
||||||
stat(path.c_str(), &st) < 0 || !S_ISREG(st.st_mode)) {
|
|
||||||
db_lock();
|
db_lock();
|
||||||
delete_song(directory, song);
|
delete_song(directory, song);
|
||||||
db_unlock();
|
db_unlock();
|
||||||
|
Loading…
Reference in New Issue
Block a user