Add error check for writing RDB checksum

Closes #857
This commit is contained in:
yoav
2014-08-27 10:30:04 +02:00
committed by antirez
parent 1580a378b8
commit ef12b4c3eb
+1 -1
View File
@@ -687,7 +687,7 @@ int rdbSave(char *filename) {
* loading code skips the check in this case. */
cksum = rdb.cksum;
memrev64ifbe(&cksum);
rioWrite(&rdb,&cksum,8);
if (rioWrite(&rdb,&cksum,8) == 0) goto werr;
/* Make sure data will not remain on the OS's output buffers */
if (fflush(fp) == EOF) goto werr;