diff --git a/libsearch/index/inotify-watch.cpp b/libsearch/index/inotify-watch.cpp index 43b36a7..b36e705 100644 --- a/libsearch/index/inotify-watch.cpp +++ b/libsearch/index/inotify-watch.cpp @@ -180,6 +180,7 @@ void InotifyWatch::run() int rc; rc = select(m_inotifyFd + 1, &fds, NULL, NULL, NULL); if(rc > 0) { + ++FileUtils::_index_status; int avail; if (ioctl(m_inotifyFd, FIONREAD, &avail) == EINVAL) { qWarning() << "Did not receive an entire inotify event."; @@ -210,6 +211,7 @@ void InotifyWatch::run() slotEvent(buf, len); free(buf); } + --FileUtils::_index_status; } else if(rc < 0) { // error qWarning() << "select result < 0, error!"; @@ -301,7 +303,6 @@ void InotifyWatch::slotEvent(char *buf, ssize_t len) m_sharedMemory->detach(); currentPath = pathMap; } - --FileUtils::_index_status; } else { assert(false); }