db/update/Walk: use Storage::OpenFile()
This commit is contained in:
parent
1b6c279850
commit
6dfdd8c1c2
@ -17,6 +17,7 @@
|
|||||||
#include "storage/FileInfo.hxx"
|
#include "storage/FileInfo.hxx"
|
||||||
#include "input/InputStream.hxx"
|
#include "input/InputStream.hxx"
|
||||||
#include "input/Error.hxx"
|
#include "input/Error.hxx"
|
||||||
|
#include "input/WaitReady.hxx"
|
||||||
#include "util/StringCompare.hxx"
|
#include "util/StringCompare.hxx"
|
||||||
#include "util/StringSplit.hxx"
|
#include "util/StringSplit.hxx"
|
||||||
#include "util/UriExtract.hxx"
|
#include "util/UriExtract.hxx"
|
||||||
@ -307,18 +308,19 @@ UpdateWalk::SkipSymlink(const Directory *directory,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
LoadExcludeListOrThrow(const Storage &storage, const Directory &directory,
|
LoadExcludeListOrThrow(Storage &storage, const Directory &directory,
|
||||||
ExcludeList &exclude_list)
|
ExcludeList &exclude_list)
|
||||||
{
|
{
|
||||||
Mutex mutex;
|
Mutex mutex;
|
||||||
auto is = InputStream::OpenReady(storage.MapUTF8(PathTraitsUTF8::Build(directory.GetPath(),
|
auto is = storage.OpenFile(PathTraitsUTF8::Build(directory.GetPath(),
|
||||||
".mpdignore")).c_str(),
|
".mpdignore"),
|
||||||
mutex);
|
mutex);
|
||||||
|
LockWaitReady(*is);
|
||||||
exclude_list.Load(std::move(is));
|
exclude_list.Load(std::move(is));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
LoadExcludeListOrLog(const Storage &storage, const Directory &directory,
|
LoadExcludeListOrLog(Storage &storage, const Directory &directory,
|
||||||
ExcludeList &exclude_list) noexcept
|
ExcludeList &exclude_list) noexcept
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
@ -456,7 +458,7 @@ UpdateWalk::DirectoryMakeUriParentChecked(Directory &root,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
LoadExcludeLists(std::forward_list<ExcludeList> &lists,
|
LoadExcludeLists(std::forward_list<ExcludeList> &lists,
|
||||||
const Storage &storage, const Directory &directory) noexcept
|
Storage &storage, const Directory &directory) noexcept
|
||||||
{
|
{
|
||||||
assert(!lists.empty());
|
assert(!lists.empty());
|
||||||
|
|
||||||
@ -468,7 +470,7 @@ LoadExcludeLists(std::forward_list<ExcludeList> &lists,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static auto
|
static auto
|
||||||
LoadExcludeLists(const Storage &storage, const Directory &directory) noexcept
|
LoadExcludeLists(Storage &storage, const Directory &directory) noexcept
|
||||||
{
|
{
|
||||||
std::forward_list<ExcludeList> lists;
|
std::forward_list<ExcludeList> lists;
|
||||||
lists.emplace_front();
|
lists.emplace_front();
|
||||||
|
Loading…
Reference in New Issue
Block a user