Cluster: fsync data when saving the cluster config.

This commit is contained in:
antirez 2013-09-30 10:13:07 +02:00
parent 026e63392e
commit 03ca903983

View File

@ -231,6 +231,7 @@ int clusterSaveConfig(void) {
if ((fd = open(server.cluster_configfile,O_WRONLY|O_CREAT|O_TRUNC,0644))
== -1) goto err;
if (write(fd,ci,sdslen(ci)) != (ssize_t)sdslen(ci)) goto err;
fsync(fd);
close(fd);
sdsfree(ci);
return 0;