diff options
author | B Stack <bgstack15@gmail.com> | 2018-11-13 06:58:56 -0500 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2018-11-13 06:58:56 -0500 |
commit | 076498028ff511afd88d93e7b0bf1d1a81093b3d (patch) | |
tree | 30bf08d782d58174a0ca212b2e4b172fabd9c42c /zen/dir_watcher.cpp | |
parent | Merge branch '10.5' into 'master' (diff) | |
download | FreeFileSync-076498028ff511afd88d93e7b0bf1d1a81093b3d.tar.gz FreeFileSync-076498028ff511afd88d93e7b0bf1d1a81093b3d.tar.bz2 FreeFileSync-076498028ff511afd88d93e7b0bf1d1a81093b3d.zip |
10.6
Diffstat (limited to 'zen/dir_watcher.cpp')
-rwxr-xr-x | zen/dir_watcher.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/zen/dir_watcher.cpp b/zen/dir_watcher.cpp index 2bb3fd26..f5ed0488 100755 --- a/zen/dir_watcher.cpp +++ b/zen/dir_watcher.cpp @@ -25,7 +25,7 @@ using namespace zen; struct DirWatcher::Impl { int notifDescr = 0; - std::map<int, Zstring> watchDescrs; //watch descriptor and (sub-)directory name (postfixed with separator) -> owned by "notifDescr" + std::map<int, Zstring> watchedPaths; //watch descriptor and (sub-)directory paths -> owned by "notifDescr" }; @@ -90,7 +90,7 @@ DirWatcher::DirWatcher(const Zstring& dirPath) : //throw FileError throw FileError(replaceCpy(_("Cannot monitor directory %x."), L"%x", fmtPath(subDirPath)), formatSystemError(L"inotify_add_watch", ec)); } - pimpl_->watchDescrs.emplace(wd, appendSeparator(subDirPath)); + pimpl_->watchedPaths.emplace(wd, subDirPath); } } @@ -130,12 +130,12 @@ std::vector<DirWatcher::Entry> DirWatcher::getChanges(const std::function<void() if (evt.len != 0) //exclude case: deletion of "self", already reported by parent directory watch { - auto it = pimpl_->watchDescrs.find(evt.wd); - if (it != pimpl_->watchDescrs.end()) + auto it = pimpl_->watchedPaths.find(evt.wd); + if (it != pimpl_->watchedPaths.end()) { //Note: evt.len is NOT the size of the evt.name c-string, but the array size including all padding 0 characters! //It may be even 0 in which case evt.name must not be used! - const Zstring itemPath = it->second + evt.name; + const Zstring itemPath = appendSeparator(it->second) + evt.name; if ((evt.mask & IN_CREATE) || (evt.mask & IN_MOVED_TO)) |