summaryrefslogtreecommitdiff
path: root/lib/DirectoryWatcher
diff options
context:
space:
mode:
authorJan Korous <jkorous@apple.com>2019-07-12 22:11:43 +0000
committerJan Korous <jkorous@apple.com>2019-07-12 22:11:43 +0000
commitbd9188670127da29d19475b073c29bcb03793c27 (patch)
tree6ab718aa607838b623963ca9fc52d078fbffdc3a /lib/DirectoryWatcher
parent2dfe7167bb09c489d4d943e130f7a39519ad5654 (diff)
downloadclang-bd9188670127da29d19475b073c29bcb03793c27.tar.gz
[DirectoryWatcher][linux] Fix use of uninitialized value
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365966 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/DirectoryWatcher')
-rw-r--r--lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp b/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp
index 986ebc5d95..87d133f46d 100644
--- a/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp
+++ b/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp
@@ -220,8 +220,8 @@ void DirectoryWatcherLinux::InotifyPollingLoop() {
// Multiple epoll_events can be received for a single file descriptor per
// epoll_wait call.
- for (const auto &EpollEvent : EpollEventBuffer) {
- if (EpollEvent.data.fd == InotifyPollingStopSignal.FDRead) {
+ for (int i = 0; i < EpollWaitResult; ++i) {
+ if (EpollEventBuffer[i].data.fd == InotifyPollingStopSignal.FDRead) {
StopWork();
return;
}