diff options
author | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2011-05-14 12:15:08 +0200 |
---|---|---|
committer | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2011-05-14 12:32:50 +0200 |
commit | fd535c58623852e480906311c48b136d3d2646bb (patch) | |
tree | c7338f0d5841966e441ba6cdbeab2d696cf36f1e /src | |
parent | 221782ccc69b4c56608942f3fe9e47773a32866e (diff) | |
download | redis-fd535c58623852e480906311c48b136d3d2646bb.tar.gz |
More rioRead()
Diffstat (limited to 'src')
-rw-r--r-- | src/rdb.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |