Use fsync instead of aof_fsync in final AOF sync.

This happens in the child process so we don't care about latency:
better to sync metadata as well.
This commit is contained in:
antirez 2014-07-04 11:51:30 +02:00
parent a99766fda1
commit 57852ff207

View File

@ -991,7 +991,7 @@ int rewriteAppendOnlyFile(char *filename) {
/* Make sure data will not remain on the OS's output buffers */
if (fflush(fp) == EOF) goto werr;
if (aof_fsync(fileno(fp)) == -1) goto werr;
if (fsync(fileno(fp)) == -1) goto werr;
if (fclose(fp) == EOF) goto werr;
/* Use RENAME to make sure the DB file is changed atomically only