Rename external payloads instead of linking and unlinking

This commit is contained in:
Jeremy Lakeman 2013-09-25 15:51:54 +09:30
parent dab07dd4dc
commit ba3f77e67c

View File

@ -503,13 +503,11 @@ int rhizome_finish_write(struct rhizome_write *write){
WHYF("Failed to generate file path");
goto dbfailure;
}
if (link(blob_path, dest_path)){
WHY_perror("link");
if (rename(blob_path, dest_path)){
WHYF_perror("rename(%s, %s)", blob_path, dest_path);
goto dbfailure;
}
if (unlink(blob_path))
WHY_perror("unlink");
}else{
if (sqlite_exec_void_retry(&retry,