Fix CopyFileTo when there is already a destination file.

This fixes reindexing files, as before we would update the json but not
the indexed file contents which caused code lens and references to get
out of sync.
This commit is contained in:
Jacob Dufault 2017-05-19 17:41:27 -07:00
parent 3e00e5fc0c
commit 54fed027ce

View File

@ -189,7 +189,7 @@ void CopyFileTo(const std::string& dest, const std::string& source) {
if (fd_from < 0) if (fd_from < 0)
return; return;
int fd_to = open(dest.c_str(), O_WRONLY | O_CREAT | O_EXCL, 0666); int fd_to = open(dest.c_str(), O_WRONLY | O_CREAT, 0666);
if (fd_to < 0) if (fd_to < 0)
goto out_error; goto out_error;