diff --git a/src/aof.c b/src/aof.c index b1c7595b5..9cd487cc4 100644 --- a/src/aof.c +++ b/src/aof.c @@ -1703,10 +1703,10 @@ void aofRemoveTempFile(pid_t childpid) { char tmpfile[256]; snprintf(tmpfile,256,"temp-rewriteaof-bg-%d.aof", (int) childpid); - unlink(tmpfile); + bg_unlink(tmpfile); snprintf(tmpfile,256,"temp-rewriteaof-%d.aof", (int) childpid); - unlink(tmpfile); + bg_unlink(tmpfile); } /* Update the server.aof_current_size field explicitly using stat(2) diff --git a/src/replication.c b/src/replication.c index 9ed4dd117..da70c4082 100644 --- a/src/replication.c +++ b/src/replication.c @@ -2444,7 +2444,7 @@ void replicationAbortSyncTransfer(void) { undoConnectWithMaster(); if (server.repl_transfer_fd!=-1) { close(server.repl_transfer_fd); - unlink(server.repl_transfer_tmpfile); + bg_unlink(server.repl_transfer_tmpfile); zfree(server.repl_transfer_tmpfile); server.repl_transfer_tmpfile = NULL; server.repl_transfer_fd = -1;