summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-08-02 11:21:05 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-08-02 11:21:05 (GMT)
commitb7256b1f8c9bb43c5234d24453aaa8b1c079cf06 (patch)
tree0d226bede5fe7c408a60c0d3c62eacda3e4621f6
parent8b8657a004c059b74b2f608d423110e8ed9e56bf (diff)
downloadQt-b7256b1f8c9bb43c5234d24453aaa8b1c079cf06.zip
Qt-b7256b1f8c9bb43c5234d24453aaa8b1c079cf06.tar.gz
Qt-b7256b1f8c9bb43c5234d24453aaa8b1c079cf06.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
-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 99c165e..378ad20 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);
}