From 5bd09cd4c5b680040a8bb6ac1ae1395499cc25b7 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 1 Jul 2010 20:18:48 +0200 Subject: [PATCH] Fix the AOF fix of the latest commit ;) --- src/aof.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/aof.c b/src/aof.c index ce177c8c..1f615cf1 100644 --- a/src/aof.c +++ b/src/aof.c @@ -501,9 +501,9 @@ int rewriteAppendOnlyFile(char *filename) { if (fwrite(cmd,sizeof(cmd)-1,1,fp) == 0) goto werr; if (fwriteBulkObject(fp,&key) == 0) goto werr; if (fwriteBulkString(fp,(char*)field,flen) == 0) - return -1; + goto werr; if (fwriteBulkString(fp,(char*)val,vlen) == 0) - return -1; + goto werr; } } else { dictIterator *di = dictGetIterator(o->ptr); @@ -515,8 +515,8 @@ int rewriteAppendOnlyFile(char *filename) { if (fwrite(cmd,sizeof(cmd)-1,1,fp) == 0) goto werr; if (fwriteBulkObject(fp,&key) == 0) goto werr; - if (fwriteBulkObject(fp,field) == -1) return REDIS_ERR; - if (fwriteBulkObject(fp,val) == -1) return REDIS_ERR; + if (fwriteBulkObject(fp,field) == 0) goto werr; + if (fwriteBulkObject(fp,val) == 0) goto werr; } dictReleaseIterator(di); }