rioInitWithFile nad rioInitWithBuffer functions now take a rio structure pointer to avoid copying a structure to return value to the caller.

This commit is contained in:
antirez
2011-09-22 16:00:40 +02:00
parent 69cecb511f
commit f96a8a8054
5 changed files with 17 additions and 18 deletions

View File

@ -597,7 +597,7 @@ int rdbSave(char *filename) {
return REDIS_ERR;
}
rdb = rioInitWithFile(fp);
rioInitWithFile(&rdb,fp);
if (rdbWriteRaw(&rdb,"REDIS0002",9) == -1) goto werr;
for (j = 0; j < server.dbnum; j++) {
@ -948,7 +948,7 @@ int rdbLoad(char *filename) {
fp = fopen(filename,"r");
if (!fp) return REDIS_ERR;
rdb = rioInitWithFile(fp);
rioInitWithFile(&rdb,fp);
if (rioRead(&rdb,buf,9) == 0) goto eoferr;
buf[9] = '\0';
if (memcmp(buf,"REDIS",5) != 0) {