From 801b1163fac3c5f93ecbfea057185c115f496f9c Mon Sep 17 00:00:00 2001 From: raakella1 <114193113+raakella1@users.noreply.github.com> Date: Thu, 4 Jan 2024 10:11:17 -0800 Subject: [PATCH] remove file from the map regardless of the inotify result during remove watch (#201) Co-authored-by: Ravi Nagarjun Akella --- conanfile.py | 2 +- src/file_watcher/file_watcher.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/conanfile.py b/conanfile.py index 01a148b2..9a19b678 100644 --- a/conanfile.py +++ b/conanfile.py @@ -8,7 +8,7 @@ class SISLConan(ConanFile): name = "sisl" - version = "8.6.5" + version = "8.6.6" homepage = "https://github.com/eBay/sisl" description = "Library for fast data structures, utilities" topics = ("ebay", "components", "core", "efficiency") diff --git a/src/file_watcher/file_watcher.cpp b/src/file_watcher/file_watcher.cpp index 05145ba1..94989052 100644 --- a/src/file_watcher/file_watcher.cpp +++ b/src/file_watcher/file_watcher.cpp @@ -119,9 +119,11 @@ bool FileWatcher::unregister_listener(const std::string& file_path, const std::s } bool FileWatcher::remove_watcher(FileInfo& file_info) { - if (auto err = inotify_rm_watch(m_inotify_fd, file_info.m_wd); err != 0) { return false; } + bool success = true; + if (auto err = inotify_rm_watch(m_inotify_fd, file_info.m_wd); err != 0) { success = false; } + // remove the file from the map regardless of the inotify_rm_watch result m_files.erase(file_info.m_filepath); - return true; + return success; } bool FileWatcher::stop() {