Skip to content

Commit

Permalink
Fix kqueue backend with nested directories
Browse files Browse the repository at this point in the history
  • Loading branch information
devongovett committed Aug 24, 2023
1 parent bdda32d commit b1b234b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/kqueue/KqueueBackend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,12 @@ bool KqueueBackend::compareDir(int fd, std::string &path, std::unordered_set<Wat
for (auto it = trees.begin(); it != trees.end(); it++) {
std::shared_ptr<DirTree> tree = *it;
for (auto entry = tree->entries.begin(); entry != tree->entries.end();) {
if (entry->first.rfind(dirStart, 0) == 0 && entries.count(entry->first) == 0) {

if (
entry->first.rfind(dirStart, 0) == 0 &&
entry->first.find(DIR_SEP, dirStart.length()) == std::string::npos &&
entries.count(entry->first) == 0
) {
// Notify all watchers with the same tree.
for (auto i = subs.begin(); i != subs.end(); i++) {
if ((*i)->tree == tree) {
Expand Down

0 comments on commit b1b234b

Please sign in to comment.