diff options
author | Tijl Coosemans <tijl@coosemans.org> | 2010-11-26 09:11:08 (GMT) |
---|---|---|
committer | João Abecasis <joao.abecasis@nokia.com> | 2010-11-26 16:07:47 (GMT) |
commit | 4ff80e53a306b1727b78b49e2de6fdafd1fb5ada (patch) | |
tree | ada0e81633d74b07aeb7dd5e2a89c2e9f22fd54f /src/corelib | |
parent | 42e861407a9977d3fa8daae5abe54e98ba6b05da (diff) | |
download | Qt-4ff80e53a306b1727b78b49e2de6fdafd1fb5ada.zip Qt-4ff80e53a306b1727b78b49e2de6fdafd1fb5ada.tar.gz Qt-4ff80e53a306b1727b78b49e2de6fdafd1fb5ada.tar.bz2 |
QKqueueFileSystemWatcherEngine: Handle kevent(2) returning EINTR.
The worker thread exits whenever the kevent call returns an error, but
in the case of EINTR (interrupted by signal) it should just call kevent
again. Otherwise for instance, attaching a debugger to the process
causes the worker thread to exit because of the SIGSTOP it receives.
Merge-request: 2425
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/io/qfilesystemwatcher_kqueue.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/io/qfilesystemwatcher_kqueue.cpp b/src/corelib/io/qfilesystemwatcher_kqueue.cpp index f66231a..4d15519 100644 --- a/src/corelib/io/qfilesystemwatcher_kqueue.cpp +++ b/src/corelib/io/qfilesystemwatcher_kqueue.cpp @@ -234,9 +234,10 @@ void QKqueueFileSystemWatcherEngine::run() static const struct timespec ZeroTimeout = { 0, 0 }; forever { + int r; struct kevent kev; DEBUG() << "QKqueueFileSystemWatcherEngine: waiting for kevents..."; - int r = kevent(kqfd, 0, 0, &kev, 1, 0); + EINTR_LOOP(r, kevent(kqfd, 0, 0, &kev, 1, 0)); if (r < 0) { perror("QKqueueFileSystemWatcherEngine: error during kevent wait"); return; |