From 27b0e70bc4f42f8770c0ca248c619e4df3fe9fd4 Mon Sep 17 00:00:00 2001 From: JJ Allaire Date: Fri, 3 Jun 2011 04:18:14 -0700 Subject: [PATCH] multicore: remove sprurious error logging from inotify directory monitor --- src/cpp/core/system/INotifyDirectoryMonitor.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/cpp/core/system/INotifyDirectoryMonitor.cpp b/src/cpp/core/system/INotifyDirectoryMonitor.cpp index 3a032fc3883..7ae11d8d069 100644 --- a/src/cpp/core/system/INotifyDirectoryMonitor.cpp +++ b/src/cpp/core/system/INotifyDirectoryMonitor.cpp @@ -177,12 +177,7 @@ Error DirectoryMonitor::checkForEvents(std::vector* pEvents) eventType = FileChangeEvent::FileAdded; else if (pEvent->mask & IN_MOVED_FROM) eventType = FileChangeEvent::FileRemoved; - else - { - LOG_WARNING_MESSAGE("Unexpected event type from inotify: " + - boost::lexical_cast(pEvent->mask)); - } - + // return event if we got a valid event type and the event applies to a // child of the monitored directory (len == 0 occurs for root element) if ((eventType != FileChangeEvent::None) && (pEvent->len > 0)) @@ -235,14 +230,9 @@ Error DirectoryMonitor::stop() if (res < 0) { // invalid argument is expected if the directory is gone - if ((errno == EINVAL) && !pImpl_->directory.exists()) - { - // don't set the error - } - else - { + // or the directory file descriptor is no longer valid + if (errno != EINVAL) removeWatchError = systemError(errno, ERROR_LOCATION); - } } // reset watch descriptor