#include <signal.h>
#include <fcntl.h>
#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <sys/wait.h>
/* Called when the user switches from "appendonly yes" to "appendonly no"
* at runtime using the CONFIG command. */
* so that Redis will not try to send replies to this client. */
c->replstate = REDIS_REPL_WAIT_BGSAVE_START;
c->reply = listCreate();
+ c->watched_keys = listCreate();
listSetFreeMethod(c->reply,decrRefCount);
listSetDupMethod(c->reply,dupClientReplyValue);
initClientMultiState(c);
void freeFakeClient(struct redisClient *c) {
sdsfree(c->querybuf);
listRelease(c->reply);
+ listRelease(c->watched_keys);
freeClientMultiState(c);
zfree(c);
}
while((p = zipmapNext(p,&field,&flen,&val,&vlen)) != NULL) {
if (fwrite(cmd,sizeof(cmd)-1,1,fp) == 0) goto werr;
if (fwriteBulkObject(fp,&key) == 0) goto werr;
- if (fwriteBulkString(fp,(char*)field,flen) == -1)
- return -1;
- if (fwriteBulkString(fp,(char*)val,vlen) == -1)
- return -1;
+ if (fwriteBulkString(fp,(char*)field,flen) == 0)
+ goto werr;
+ if (fwriteBulkString(fp,(char*)val,vlen) == 0)
+ goto werr;
}
} else {
dictIterator *di = dictGetIterator(o->ptr);
if (fwrite(cmd,sizeof(cmd)-1,1,fp) == 0) goto werr;
if (fwriteBulkObject(fp,&key) == 0) goto werr;
- if (fwriteBulkObject(fp,field) == -1) return -1;
- if (fwriteBulkObject(fp,val) == -1) return -1;
+ if (fwriteBulkObject(fp,field) == 0) goto werr;
+ if (fwriteBulkObject(fp,val) == 0) goto werr;
}
dictReleaseIterator(di);
}