From cab22f2dc3c5f41b5163f74cbb233e390edff6ff Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Tue, 11 Oct 2022 11:16:39 -0400 Subject: add upstream 11.26 --- zen/dir_watcher.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'zen/dir_watcher.cpp') 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::fetchChanges(const std::function& requestUiUpdate, std::chrono::milliseconds cbInterval) //throw FileError { - std::vector buffer(512 * (sizeof(inotify_event) + NAME_MAX + 1)); + std::vector 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::fetchChanges(const std::function(buffer[bytePos]); + inotify_event& evt = reinterpret_cast(buf[bytePos]); if (evt.len != 0) //exclude case: deletion of "self", already reported by parent directory watch { -- cgit