Skip to content

Commit

Permalink
remove file from the map regardless of the inotify result during remo…
Browse files Browse the repository at this point in the history
…ve watch (eBay#201)

Co-authored-by: Ravi Nagarjun Akella <raakella1@$HOSTNAME>
  • Loading branch information
raakella1 and Ravi Nagarjun Akella authored Jan 4, 2024
1 parent cbc315f commit 801b116
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 4 additions & 2 deletions src/file_watcher/file_watcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 801b116

Please sign in to comment.