summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPieter Noordhuis <pcnoordhuis@gmail.com>2011-05-14 12:15:08 +0200
committerPieter Noordhuis <pcnoordhuis@gmail.com>2011-05-14 12:32:50 +0200
commitfd535c58623852e480906311c48b136d3d2646bb (patch)
treec7338f0d5841966e441ba6cdbeab2d696cf36f1e /src
parent221782ccc69b4c56608942f3fe9e47773a32866e (diff)
downloadredis-fd535c58623852e480906311c48b136d3d2646bb.tar.gz
More rioRead()
Diffstat (limited to 'src')
-rw-r--r--src/rdb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rdb.c b/src/rdb.c
index ee992809e..d9c819406 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;