diff --git a/far/changelog b/far/changelog index 4768e9c14a..fc1651c37c 100644 --- a/far/changelog +++ b/far/changelog @@ -1,3 +1,8 @@ +-------------------------------------------------------------------------------- +drkns 2024-10-29 18:54:27+00:00 - build 6387 + +1. Continue 6385.5. + -------------------------------------------------------------------------------- drkns 2024-10-29 02:35:48+00:00 - build 6386 diff --git a/far/filesystemwatcher.cpp b/far/filesystemwatcher.cpp index 97a1f8d897..ed608a1714 100644 --- a/far/filesystemwatcher.cpp +++ b/far/filesystemwatcher.cpp @@ -63,7 +63,7 @@ class background_watcher: public singleton IMPLEMENTS_SINGLETON; public: - void add(const FileSystemWatcher* Client) + void add(FileSystemWatcher* Client) { SCOPED_ACTION(std::scoped_lock)(m_CS); @@ -117,7 +117,7 @@ class background_watcher: public singleton auto PendingHandleCopy = std::exchange(PendingHandle, {}); Handles.resize(1); - std::ranges::transform(m_Clients, std::back_inserter(Handles), [&](const FileSystemWatcher* const Client) + std::ranges::transform(m_Clients, std::back_inserter(Handles), [&](FileSystemWatcher* const Client) { const auto Handle = Client->m_Event.native_handle(); if (Handle == PendingHandleCopy) @@ -151,7 +151,7 @@ class background_watcher: public singleton m_Clients[Result - 1]->callback_notify(); - for (const auto& Client: m_Clients) + for (auto& Client: m_Clients) { if (Client != m_Clients[Result - 1] && Client->m_Event.is_signaled()) Client->callback_notify(); @@ -173,7 +173,7 @@ class background_watcher: public singleton os::critical_section m_CS; os::event m_Update{ os::event::type::automatic, os::event::state::nonsignaled }; os::event m_Synchronised{ os::event::type::manual, os::event::state::nonsignaled }; - std::vector m_Clients; + std::vector m_Clients; std::atomic_bool m_Exit{}; os::thread m_Thread; }; @@ -248,7 +248,7 @@ FileSystemWatcher::~FileSystemWatcher() } } -void FileSystemWatcher::read_async() const +void FileSystemWatcher::read_async() { m_Event.reset(); @@ -271,6 +271,7 @@ void FileSystemWatcher::read_async() const )) { LOGERROR(L"ReadDirectoryChangesW({}): {}"sv, m_Directory, os::last_error()); + m_DirectoryHandle = {}; } } @@ -297,7 +298,7 @@ bool FileSystemWatcher::get_result() const } } -void FileSystemWatcher::callback_notify() const +void FileSystemWatcher::callback_notify() { if (!m_DirectoryHandle) return; diff --git a/far/filesystemwatcher.hpp b/far/filesystemwatcher.hpp index dba3bccfcb..2be9b12afa 100644 --- a/far/filesystemwatcher.hpp +++ b/far/filesystemwatcher.hpp @@ -57,9 +57,9 @@ class FileSystemWatcher private: friend class background_watcher; - void read_async() const; + void read_async(); bool get_result() const; - void callback_notify() const; + void callback_notify(); string m_EventId; string m_Directory; diff --git a/far/vbuild.m4 b/far/vbuild.m4 index 6d296867c5..cc7f6c5356 100644 --- a/far/vbuild.m4 +++ b/far/vbuild.m4 @@ -1 +1 @@ -6386 +6387