Skip to content

Commit

Permalink
ReadDirectoryChangesNotification now calls StartMonitoringDirForChang…
Browse files Browse the repository at this point in the history
…es to continue monitoring the watched dir even if bytesTransfered = 0, which probably means an overflow.
  • Loading branch information
TwoEpsilon authored and kjk committed Nov 3, 2023
1 parent f7f3f39 commit 81cd22e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/utils/FileWatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,11 @@ static void CALLBACK ReadDirectoryChangesNotification(DWORD errCode, DWORD bytes
return;
}

wd->startMonitoring = false;

// This might mean overflow? Not sure.
if (!bytesTransfered) {
if (!bytesTransfered) {
StartMonitoringDirForChanges(wd);
return;
}

Expand Down Expand Up @@ -250,7 +253,6 @@ static void CALLBACK ReadDirectoryChangesNotification(DWORD errCode, DWORD bytes
notify = (FILE_NOTIFY_INFORMATION*)((char*)notify + nextOff);
}

wd->startMonitoring = false;
StartMonitoringDirForChanges(wd);

for (char* f : changedFiles) {
Expand Down

0 comments on commit 81cd22e

Please sign in to comment.