From fd535c58623852e480906311c48b136d3d2646bb Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Sat, 14 May 2011 12:15:08 +0200 Subject: [PATCH] More rioRead() --- src/rdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rdb.c b/src/rdb.c index ee992809..d9c81940 100644 --- a/src/rdb.c +++ b/src/rdb.c @@ -956,7 +956,8 @@ int rdbLoad(char *filename) { fp = fopen(filename,"r"); if (!fp) return REDIS_ERR; - if (fread(buf,9,1,fp) == 0) goto eoferr; + rdb = rioInitWithFile(fp); + if (rioRead(&rdb,buf,9) == 0) goto eoferr; buf[9] = '\0'; if (memcmp(buf,"REDIS",5) != 0) { fclose(fp); @@ -971,7 +972,6 @@ int rdbLoad(char *filename) { } startLoading(fp); - rdb = rioInitWithFile(fp); while(1) { robj *key, *val; expiretime = -1; -- 2.45.2