summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTijl Coosemans <tijl@coosemans.org>2010-11-26 09:11:06 (GMT)
committerJoão Abecasis <joao.abecasis@nokia.com>2010-11-26 09:11:06 (GMT)
commit1753380c39e3b845f6acee21ce25bad75dbf910c (patch)
tree2abcb4820d5f0c4d2d87877e63fc66b60a74e84a /src
parentd779f70e3012e85bee42e974afe6bfc7320d8302 (diff)
downloadQt-1753380c39e3b845f6acee21ce25bad75dbf910c.zip
Qt-1753380c39e3b845f6acee21ce25bad75dbf910c.tar.gz
Qt-1753380c39e3b845f6acee21ce25bad75dbf910c.tar.bz2
QKqueueFileSystemWatcherEngine: Use EV_CLEAR instead of EV_ONESHOT.
Using EV_ONESHOT and re-enabling the kevent after emitting the signal allows for a window in which file system changes can go undetected. By using EV_CLEAR instead the kevent can stay enabled. Merge-request: 2425 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qfilesystemwatcher_kqueue.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/corelib/io/qfilesystemwatcher_kqueue.cpp b/src/corelib/io/qfilesystemwatcher_kqueue.cpp
index 7960792..6e7a402 100644
--- a/src/corelib/io/qfilesystemwatcher_kqueue.cpp
+++ b/src/corelib/io/qfilesystemwatcher_kqueue.cpp
@@ -159,7 +159,7 @@ QStringList QKqueueFileSystemWatcherEngine::addPaths(const QStringList &paths,
EV_SET(&kev,
fd,
EVFILT_VNODE,
- EV_ADD | EV_ENABLE | EV_ONESHOT,
+ EV_ADD | EV_ENABLE | EV_CLEAR,
NOTE_DELETE | NOTE_WRITE | NOTE_EXTEND | NOTE_ATTRIB | NOTE_RENAME | NOTE_REVOKE,
0,
0);
@@ -317,24 +317,12 @@ void QKqueueFileSystemWatcherEngine::run()
else
emit fileChanged(path, true);
} else {
- DEBUG() << path << "changed, re-enabling watch";
+ DEBUG() << path << "changed";
if (id < 0)
emit directoryChanged(path, false);
else
emit fileChanged(path, false);
-
- // renable the watch
- EV_SET(&kev,
- fd,
- EVFILT_VNODE,
- EV_ADD | EV_ENABLE | EV_ONESHOT,
- NOTE_DELETE | NOTE_WRITE | NOTE_EXTEND | NOTE_ATTRIB | NOTE_RENAME | NOTE_REVOKE,
- 0,
- 0);
- if (kevent(kqfd, &kev, 1, 0, 0, 0) == -1) {
- perror("QKqueueFileSystemWatcherEngine::processKqueueEvents: kevent EV_ADD");
- }
}
}