summaryrefslogtreecommitdiff
path: root/zen/dir_watcher.cpp
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2022-10-11 11:16:39 -0400
committerB. Stack <bgstack15@gmail.com>2022-10-11 11:16:39 -0400
commitcab22f2dc3c5f41b5163f74cbb233e390edff6ff (patch)
treea49cfd729d9793681a57fa6f7409b0f0848e9ede /zen/dir_watcher.cpp
parentMerge branch 'b11.25' into 'master' (diff)
downloadFreeFileSync-cab22f2dc3c5f41b5163f74cbb233e390edff6ff.tar.gz
FreeFileSync-cab22f2dc3c5f41b5163f74cbb233e390edff6ff.tar.bz2
FreeFileSync-cab22f2dc3c5f41b5163f74cbb233e390edff6ff.zip
add upstream 11.26
Diffstat (limited to 'zen/dir_watcher.cpp')
-rw-r--r--zen/dir_watcher.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/zen/dir_watcher.cpp b/zen/dir_watcher.cpp
index c48928a3..87fa3596 100644
--- a/zen/dir_watcher.cpp
+++ b/zen/dir_watcher.cpp
@@ -101,13 +101,13 @@ DirWatcher::~DirWatcher()
std::vector<DirWatcher::Change> DirWatcher::fetchChanges(const std::function<void()>& requestUiUpdate, std::chrono::milliseconds cbInterval) //throw FileError
{
- std::vector<std::byte> buffer(512 * (sizeof(inotify_event) + NAME_MAX + 1));
+ std::vector<std::byte> buf(512 * (sizeof(inotify_event) + NAME_MAX + 1));
ssize_t bytesRead = 0;
do
{
//non-blocking call, see O_NONBLOCK
- bytesRead = ::read(pimpl_->notifDescr, &buffer[0], buffer.size());
+ bytesRead = ::read(pimpl_->notifDescr, buf.data(), buf.size());
}
while (bytesRead < 0 && errno == EINTR); //"Interrupted function call; When this happens, you should try the call again."
@@ -124,7 +124,7 @@ std::vector<DirWatcher::Change> DirWatcher::fetchChanges(const std::function<voi
ssize_t bytePos = 0;
while (bytePos < bytesRead)
{
- inotify_event& evt = reinterpret_cast<inotify_event&>(buffer[bytePos]);
+ inotify_event& evt = reinterpret_cast<inotify_event&>(buf[bytePos]);
if (evt.len != 0) //exclude case: deletion of "self", already reported by parent directory watch
{
bgstack15