diff options
Diffstat (limited to 'zen/dir_watcher.cpp')
-rw-r--r-- | zen/dir_watcher.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/zen/dir_watcher.cpp b/zen/dir_watcher.cpp index 769aa4f2..12a6a9f4 100644 --- a/zen/dir_watcher.cpp +++ b/zen/dir_watcher.cpp @@ -194,7 +194,7 @@ public: true, //__in BOOL bManualReset, false, //__in BOOL bInitialState, nullptr); //__in_opt LPCTSTR lpName - if (overlapped.hEvent == nullptr) + if (!overlapped.hEvent) { const DWORD ec = ::GetLastError(); //copy before directly/indirectly making other system calls! return shared_->reportError(replaceCpy(_("Cannot monitor directory %x."), L"%x", fmtPath(dirPathPf)), formatSystemError(L"CreateEvent", ec)); @@ -319,7 +319,7 @@ private: } -struct DirWatcher::Pimpl +struct DirWatcher::Impl { InterruptibleThread worker; std::shared_ptr<SharedData> shared; @@ -329,7 +329,7 @@ struct DirWatcher::Pimpl DirWatcher::DirWatcher(const Zstring& dirPath) : //throw FileError baseDirPath(dirPath), - pimpl_(std::make_unique<Pimpl>()) + pimpl_(std::make_unique<Impl>()) { pimpl_->shared = std::make_shared<SharedData>(); @@ -345,7 +345,7 @@ DirWatcher::~DirWatcher() { pimpl_->worker.interrupt(); pimpl_->worker.detach(); //we don't have time to wait... would take ~50ms - //Windows caveat: exitting the app will kill the thread and leak memory! + //Windows caveat: exitting the app will kill the thread and leak memory! } } @@ -375,7 +375,7 @@ std::vector<DirWatcher::Entry> DirWatcher::getChanges(const std::function<void() #elif defined ZEN_LINUX -struct DirWatcher::Pimpl +struct DirWatcher::Impl { int notifDescr = 0; std::map<int, Zstring> watchDescrs; //watch descriptor and (sub-)directory name (postfixed with separator) -> owned by "notifDescr" @@ -384,7 +384,7 @@ struct DirWatcher::Pimpl DirWatcher::DirWatcher(const Zstring& dirPath) : //throw FileError baseDirPath(dirPath), - pimpl_(std::make_unique<Pimpl>()) + pimpl_(std::make_unique<Impl>()) { //get all subdirectories std::vector<Zstring> fullFolderList { baseDirPath }; @@ -553,7 +553,7 @@ void eventCallback(ConstFSEventStreamRef streamRef, } -struct DirWatcher::Pimpl +struct DirWatcher::Impl { FSEventStreamRef eventStream = nullptr; std::vector<DirWatcher::Entry> changedFiles; @@ -562,7 +562,7 @@ struct DirWatcher::Pimpl DirWatcher::DirWatcher(const Zstring& dirPath) : baseDirPath(dirPath), - pimpl_(std::make_unique<Pimpl>()) + pimpl_(std::make_unique<Impl>()) { CFStringRef dirpathCf = nullptr; try |