diff --git a/src/macos/FSEventsBackend.cc b/src/macos/FSEventsBackend.cc index b8cec030..5bbdcc34 100644 --- a/src/macos/FSEventsBackend.cc +++ b/src/macos/FSEventsBackend.cc @@ -1,11 +1,14 @@ #include #include -#include + #include +#include +#include #include -#include "../Event.hh" -#include "../Backend.hh" + #include "./FSEventsBackend.hh" +#include "../Backend.hh" +#include "../Event.hh" #include "../Watcher.hh" #define CONVERT_TIME(ts) ((uint64_t)ts.tv_sec * 1000000000 + ts.tv_nsec) @@ -91,9 +94,16 @@ void FSEventsCallback( if (isModified && (existed || ctime <= since)) { state->tree->update(paths[i], mtime); list->update(paths[i]); - } else { + } else if (isCreated || isRenamed) { state->tree->add(paths[i], mtime, S_ISDIR(file.st_mode)); list->create(paths[i]); + } else { + std::ostringstream errorMsgStream; + errorMsgStream << "Unknown set of flags for path " << paths[i] << ": " + << std::hex << eventFlags[i]; + std::exception watcherError = + WatcherError(std::string(errorMsgStream.str()), watcher); + watcher->notifyError(watcherError); } } }