From ba3f77e67c9ded004411bcb4c7a10b63327e80e7 Mon Sep 17 00:00:00 2001 From: Jeremy Lakeman Date: Wed, 25 Sep 2013 15:51:54 +0930 Subject: [PATCH] Rename external payloads instead of linking and unlinking --- rhizome_store.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/rhizome_store.c b/rhizome_store.c index d509078d..6b69239a 100644 --- a/rhizome_store.c +++ b/rhizome_store.c @@ -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,