diff options
author | Daniel Wilhelm <daniel@wili.li> | 2015-10-02 14:55:46 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2015-10-02 14:55:46 +0200 |
commit | b32d1e948b32a8f7607ebc30f10dda903426f63c (patch) | |
tree | 7fa78f18308671970198981b650e237bcd84957e /zen/dir_watcher.cpp | |
parent | 7.0 (diff) | |
download | FreeFileSync-b32d1e948b32a8f7607ebc30f10dda903426f63c.tar.gz FreeFileSync-b32d1e948b32a8f7607ebc30f10dda903426f63c.tar.bz2 FreeFileSync-b32d1e948b32a8f7607ebc30f10dda903426f63c.zip |
7.1
Diffstat (limited to 'zen/dir_watcher.cpp')
-rw-r--r-- | zen/dir_watcher.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/zen/dir_watcher.cpp b/zen/dir_watcher.cpp index a948a5e8..a97ea80d 100644 --- a/zen/dir_watcher.cpp +++ b/zen/dir_watcher.cpp @@ -220,8 +220,11 @@ public: zen::ScopeGuard guardAio = zen::makeGuard([&] { //Canceling Pending I/O Operations: http://msdn.microsoft.com/en-us/library/aa363789(v=vs.85).aspx - //if (::CancelIoEx(hDir, &overlapped) /*!= FALSE*/ || ::GetLastError() != ERROR_NOT_FOUND) -> Vista only +#ifdef ZEN_WIN_VISTA_AND_LATER + if (::CancelIoEx(hDir, &overlapped) /*!= FALSE*/ || ::GetLastError() != ERROR_NOT_FOUND) +#else if (::CancelIo(hDir) /*!= FALSE*/ || ::GetLastError() != ERROR_NOT_FOUND) +#endif { DWORD bytesWritten = 0; ::GetOverlappedResult(hDir, &overlapped, &bytesWritten, true); //wait until cancellation is complete @@ -441,7 +444,7 @@ DirWatcher::DirWatcher(const Zstring& dirPath) : //throw FileError const auto ec = getLastError(); if (ec == ENOSPC) //fix misleading system message "No space left on device" throw FileError(replaceCpy(_("Cannot monitor directory %x."), L"%x", fmtFileName(subDirPath)), - formatSystemError(L"inotify_add_watch", ec, L"The user limit on the total number of inotify watches was reached or the kernel failed to allocate a needed resource.")); + formatSystemError(L"inotify_add_watch", ec, L"The user limit on the total number of inotify watches was reached or the kernel failed to allocate a needed resource.")); throw FileError(replaceCpy(_("Cannot monitor directory %x."), L"%x", fmtFileName(subDirPath)), formatSystemError(L"inotify_add_watch", ec)); } |