db/update/InotifyUpdate: use OpenLocalInputStream()

This commit is contained in:
Max Kellermann 2024-05-15 14:47:13 +02:00
parent 1f47fe47c7
commit a701da6386
1 changed files with 5 additions and 2 deletions

View File

@ -9,6 +9,8 @@
#include "storage/StorageInterface.hxx" #include "storage/StorageInterface.hxx"
#include "input/InputStream.hxx" #include "input/InputStream.hxx"
#include "input/Error.hxx" #include "input/Error.hxx"
#include "input/LocalOpen.hxx"
#include "input/WaitReady.hxx"
#include "fs/AllocatedPath.hxx" #include "fs/AllocatedPath.hxx"
#include "fs/DirectoryReader.hxx" #include "fs/DirectoryReader.hxx"
#include "fs/FileInfo.hxx" #include "fs/FileInfo.hxx"
@ -71,8 +73,9 @@ void
WatchDirectory::LoadExcludeList(Path directory_path) noexcept WatchDirectory::LoadExcludeList(Path directory_path) noexcept
try { try {
Mutex mutex; Mutex mutex;
auto is = InputStream::OpenReady((directory_path / Path::FromFS(".mpdignore")).c_str(), auto is = OpenLocalInputStream(directory_path / Path::FromFS(".mpdignore"),
mutex); mutex);
LockWaitReady(*is);
exclude_list.Load(std::move(is)); exclude_list.Load(std::move(is));
} catch (...) { } catch (...) {
if (!IsFileNotFound(std::current_exception())) if (!IsFileNotFound(std::current_exception()))