summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-08-02 11:21:05 (GMT)
committerSamuli Piippo <samuli.piippo@digia.com>2011-06-09 10:06:37 (GMT)
commit7da79f8d44ba06872e5bf298fde7a3fc45df7046 (patch)
tree26e2c14fbd7f99923a114732c18338f5a5708a29
parente4a3da5e3af84e3c576718236c490feac3f31703 (diff)
downloadQt-7da79f8d44ba06872e5bf298fde7a3fc45df7046.zip
Qt-7da79f8d44ba06872e5bf298fde7a3fc45df7046.tar.gz
Qt-7da79f8d44ba06872e5bf298fde7a3fc45df7046.tar.bz2
Fixed potential infinite loop in QFileSystemWatcher on Mac.
The patch provided by the customer just jumps to reading the next event fom the kqueue when an unexpected condition happens. Task-number: QTBUG-12533 Reviewed-by: Bradley T. Hughes (cherry picked from commit b7256b1f8c9bb43c5234d24453aaa8b1c079cf06)
-rw-r--r--src/corelib/io/qfilesystemwatcher_kqueue.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/corelib/io/qfilesystemwatcher_kqueue.cpp b/src/corelib/io/qfilesystemwatcher_kqueue.cpp
index a64b524..a42a695 100644
--- a/src/corelib/io/qfilesystemwatcher_kqueue.cpp
+++ b/src/corelib/io/qfilesystemwatcher_kqueue.cpp
@@ -295,12 +295,12 @@ void QKqueueFileSystemWatcherEngine::run()
path = idToPath.value(id);
if (path.isEmpty()) {
DEBUG() << "QKqueueFileSystemWatcherEngine: received a kevent for a file we're not watching";
- continue;
+ goto process_next_event;
}
}
if (kev.filter != EVFILT_VNODE) {
DEBUG() << "QKqueueFileSystemWatcherEngine: received a kevent with the wrong filter";
- continue;
+ goto process_next_event;
}
if ((kev.fflags & (NOTE_DELETE | NOTE_REVOKE | NOTE_RENAME)) != 0) {
@@ -337,6 +337,7 @@ void QKqueueFileSystemWatcherEngine::run()
}
// are there any more?
+process_next_event:
r = kevent(kqfd, 0, 0, &kev, 1, &ZeroTimeout);
} while (r > 0);
}