Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
fd535c58
Commit
fd535c58
authored
May 14, 2011
by
Pieter Noordhuis
Browse files
More rioRead()
parent
221782cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/rdb.c
View file @
fd535c58
...
@@ -956,7 +956,8 @@ int rdbLoad(char *filename) {
...
@@ -956,7 +956,8 @@ int rdbLoad(char *filename) {
fp
=
fopen
(
filename
,
"r"
);
fp
=
fopen
(
filename
,
"r"
);
if
(
!
fp
)
return
REDIS_ERR
;
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'
;
buf
[
9
]
=
'\0'
;
if
(
memcmp
(
buf
,
"REDIS"
,
5
)
!=
0
)
{
if
(
memcmp
(
buf
,
"REDIS"
,
5
)
!=
0
)
{
fclose
(
fp
);
fclose
(
fp
);
...
@@ -971,7 +972,6 @@ int rdbLoad(char *filename) {
...
@@ -971,7 +972,6 @@ int rdbLoad(char *filename) {
}
}
startLoading
(
fp
);
startLoading
(
fp
);
rdb
=
rioInitWithFile
(
fp
);
while
(
1
)
{
while
(
1
)
{
robj
*
key
,
*
val
;
robj
*
key
,
*
val
;
expiretime
=
-
1
;
expiretime
=
-
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment