diff --git a/src/modules/vfs/src/eepp/vfs/watchers/localwatchbackend.cpp b/src/modules/vfs/src/eepp/vfs/watchers/localwatchbackend.cpp index 6d72b491f..e33d006d0 100644 --- a/src/modules/vfs/src/eepp/vfs/watchers/localwatchbackend.cpp +++ b/src/modules/vfs/src/eepp/vfs/watchers/localwatchbackend.cpp @@ -81,6 +81,13 @@ class LocalWatchBackendImpl : public std::enable_shared_from_this lock( mEntriesMutex ); Entry& entry = mEntries[composite]; entry.rootPath = root; +#if EE_PLATFORM == EE_PLATFORM_MACOS + // FSEvents reports resolved paths: /private/var/... for a root under /var. + std::string realRoot( System::FileSystem::getRealPath( nativeRoot ) ); + System::FileSystem::dirAddSlashAtEnd( realRoot ); + if ( realRoot != root ) + entry.realRootPath = std::move( realRoot ); +#endif entry.recursive = options.recursive; entry.sinks.emplace_back( token, sink ); auto& highest = mHighestId[key]; @@ -142,8 +149,11 @@ class LocalWatchBackendImpl : public std::enable_shared_from_thissecond.rootPath; - for ( auto& sink : it->second.sinks ) + const Entry& entry = it->second; + root = !entry.realRootPath.empty() && String::startsWith( dir, entry.realRootPath ) + ? entry.realRootPath + : entry.rootPath; + for ( auto& sink : entry.sinks ) if ( auto locked = sink.second.lock() ) sinks.push_back( std::move( locked ) ); } @@ -225,6 +235,9 @@ class LocalWatchBackendImpl : public std::enable_shared_from_this>> sinks; bool recursive{ false }; }; diff --git a/src/thirdparty/efsw b/src/thirdparty/efsw index 36c57df5a..58a105f56 160000 --- a/src/thirdparty/efsw +++ b/src/thirdparty/efsw @@ -1 +1 @@ -Subproject commit 36c57df5a2d713e1b087439f6d1a19d064c21056 +Subproject commit 58a105f56aa8dcc1a8771121bd196c7e2c6e4ef1