Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
c7543ab6
Commit
c7543ab6
authored
Jul 01, 2010
by
antirez
Browse files
fixed error code checking for *write operations and return value in AOF rewriting function
parent
e8de5c7a
Changes
1
Hide whitespace changes
Inline
Side-by-side
redis.c
View file @
c7543ab6
...
@@ -8618,10 +8618,10 @@ static int rewriteAppendOnlyFile(char *filename) {
...
@@ -8618,10 +8618,10 @@ static int rewriteAppendOnlyFile(char *filename) {
while
((
p
=
zipmapNext
(
p
,
&
field
,
&
flen
,
&
val
,
&
vlen
))
!=
NULL
)
{
while
((
p
=
zipmapNext
(
p
,
&
field
,
&
flen
,
&
val
,
&
vlen
))
!=
NULL
)
{
if
(
fwrite
(
cmd
,
sizeof
(
cmd
)
-
1
,
1
,
fp
)
==
0
)
goto
werr
;
if
(
fwrite
(
cmd
,
sizeof
(
cmd
)
-
1
,
1
,
fp
)
==
0
)
goto
werr
;
if
(
fwriteBulkObject
(
fp
,
key
)
==
0
)
goto
werr
;
if
(
fwriteBulkObject
(
fp
,
key
)
==
0
)
goto
werr
;
if
(
fwriteBulkString
(
fp
,(
char
*
)
field
,
flen
)
==
-
1
)
if
(
fwriteBulkString
(
fp
,(
char
*
)
field
,
flen
)
==
0
)
return
-
1
;
goto
werr
;
if
(
fwriteBulkString
(
fp
,(
char
*
)
val
,
vlen
)
==
-
1
)
if
(
fwriteBulkString
(
fp
,(
char
*
)
val
,
vlen
)
==
0
)
return
-
1
;
goto
werr
;
}
}
}
else
{
}
else
{
dictIterator
*
di
=
dictGetIterator
(
o
->
ptr
);
dictIterator
*
di
=
dictGetIterator
(
o
->
ptr
);
...
@@ -8633,8 +8633,8 @@ static int rewriteAppendOnlyFile(char *filename) {
...
@@ -8633,8 +8633,8 @@ static int rewriteAppendOnlyFile(char *filename) {
if
(
fwrite
(
cmd
,
sizeof
(
cmd
)
-
1
,
1
,
fp
)
==
0
)
goto
werr
;
if
(
fwrite
(
cmd
,
sizeof
(
cmd
)
-
1
,
1
,
fp
)
==
0
)
goto
werr
;
if
(
fwriteBulkObject
(
fp
,
key
)
==
0
)
goto
werr
;
if
(
fwriteBulkObject
(
fp
,
key
)
==
0
)
goto
werr
;
if
(
fwriteBulkObject
(
fp
,
field
)
==
-
1
)
return
-
1
;
if
(
fwriteBulkObject
(
fp
,
field
)
==
0
)
goto
werr
;
if
(
fwriteBulkObject
(
fp
,
val
)
==
-
1
)
return
-
1
;
if
(
fwriteBulkObject
(
fp
,
val
)
==
0
)
goto
werr
;
}
}
dictReleaseIterator
(
di
);
dictReleaseIterator
(
di
);
}
}
...
...
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