Skip to content

Commit

Permalink
Update monitor.d
Browse files Browse the repository at this point in the history
* Pull in suggested fix from #2586
  • Loading branch information
abraunegg committed Dec 12, 2024
1 parent a633f29 commit d191208
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/monitor.d
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,12 @@ final class Monitor {
} else if (event.mask & IN_CREATE) {
if (debugLogging) {addLogEntry("event IN_CREATE: " ~ path, ["debug"]);}
if (event.mask & IN_ISDIR) {
// fix from #2586
foreach (cookie, path1; cookieToPath1) {
if (path1 == path) {
cookieToPath.remove(cookie);
}
}
addRecursive(path);
if (useCallbacks) actionHolder.append(ActionType.createDir, path);
}
Expand All @@ -622,6 +628,13 @@ final class Monitor {
}
} else if ((event.mask & IN_CLOSE_WRITE) && !(event.mask & IN_ISDIR)) {
if (debugLogging) {addLogEntry("event IN_CLOSE_WRITE and not IN_ISDIR: " ~ path, ["debug"]);}
// fix from #2586
auto cookieToPath1 = cookieToPath.dup();
foreach (cookie, path1; cookieToPath1) {
if (path1 == path) {
cookieToPath.remove(cookie);
}
}
if (useCallbacks) actionHolder.append(ActionType.changed, path);
} else {
addLogEntry("inotify event unhandled: " ~ path);
Expand Down

0 comments on commit d191208

Please sign in to comment.