Browse Source

Added workaround for Invalid cross-device link error

merge-requests/413/merge
eidheim 2 years ago
parent
commit
f6aeb314f0
  1. 7
      src/usages_clang.cpp

7
src/usages_clang.cpp

@ -737,7 +737,12 @@ void Usages::Clang::write_cache(const boost::filesystem::path &path, const Clang
stream.close(); stream.close();
boost::filesystem::rename(tmp_file, full_cache_path, ec); boost::filesystem::rename(tmp_file, full_cache_path, ec);
if(ec) { if(ec) {
boost::filesystem::copy_file(tmp_file, full_cache_path, boost::filesystem::copy_options::overwrite_existing); boost::filesystem::copy_file(tmp_file, full_cache_path, boost::filesystem::copy_options::overwrite_existing, ec);
if(ec) { // Workaround for Invalid cross-device link error
std::ifstream from(tmp_file.string(), std::ios::binary);
std::ofstream to(full_cache_path.string(), std::ios::binary);
to << from.rdbuf();
}
boost::filesystem::remove(tmp_file, ec); boost::filesystem::remove(tmp_file, ec);
} }
} }

Loading…
Cancel
Save