diff --git a/deps/watchdog/Watchdog.h b/deps/watchdog/Watchdog.h index 735c0c6e..d9f7aa25 100644 --- a/deps/watchdog/Watchdog.h +++ b/deps/watchdog/Watchdog.h @@ -119,7 +119,13 @@ protected: // keep watching for modifications every ms milliseconds auto ms = std::chrono::milliseconds( 500 ); while( mWatching ) { + if( mFileWatchers.empty() ) + { + std::this_thread::sleep_for( ms ); + continue; + } do { + // iterate through each watcher and check for modification std::lock_guard lock( mMutex ); auto end = mFileWatchers.end(); diff --git a/src/common/Config/ConfigMgr.cpp b/src/common/Config/ConfigMgr.cpp index 1fdc9af0..8b72bf1a 100644 --- a/src/common/Config/ConfigMgr.cpp +++ b/src/common/Config/ConfigMgr.cpp @@ -17,7 +17,8 @@ bool Core::ConfigMgr::loadConfig( const std::string& configName ) if( !fs::exists( configFile ) ) { - copyDefaultConfig( configName ); + if( !copyDefaultConfig( configName ) ) + return false; } m_pInih = std::unique_ptr< INIReader >( new INIReader( configFile.string() ) );