Merge pull request #461 from hharte/fix_upgrade_windows

upgrade-flux-file: Fix for Windows
This commit is contained in:
David Given
2022-02-19 21:29:54 +00:00
committed by GitHub

View File

@@ -300,6 +300,12 @@ int main(int argc, const char* argv[])
std::cout << "Writing output file...\n";
}
sqlite3_close(db);
if (remove(filename.c_str()) != 0)
Error() << fmt::format(
"couldn't remove input file: {}", strerror(errno));
if (rename(outFilename.c_str(), filename.c_str()) != 0)
Error() << fmt::format(
"couldn't replace input file: {}", strerror(errno));