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
a425e1d2
Unverified
Commit
a425e1d2
authored
Oct 20, 2020
by
Oran Agra
Committed by
GitHub
Oct 20, 2020
Browse files
fix 32bit build warnings (#7926)
parent
04a0af90
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/config.c
View file @
a425e1d2
...
@@ -1610,7 +1610,7 @@ int rewriteConfigOverwriteFile(char *configfile, sds content) {
...
@@ -1610,7 +1610,7 @@ int rewriteConfigOverwriteFile(char *configfile, sds content) {
written_bytes
=
write
(
fd
,
content
+
offset
,
sdslen
(
content
)
-
offset
);
written_bytes
=
write
(
fd
,
content
+
offset
,
sdslen
(
content
)
-
offset
);
if
(
written_bytes
<=
0
)
{
if
(
written_bytes
<=
0
)
{
if
(
errno
==
EINTR
)
continue
;
/* FD is blocking, no other retryable errors */
if
(
errno
==
EINTR
)
continue
;
/* FD is blocking, no other retryable errors */
serverLog
(
LL_WARNING
,
"Failed after writing (%
l
d) bytes to tmp config file (%s)"
,
offset
,
strerror
(
errno
));
serverLog
(
LL_WARNING
,
"Failed after writing (%
z
d) bytes to tmp config file (%s)"
,
offset
,
strerror
(
errno
));
goto
cleanup
;
goto
cleanup
;
}
}
offset
+=
written_bytes
;
offset
+=
written_bytes
;
...
...
src/listpack.c
View file @
a425e1d2
...
@@ -768,10 +768,10 @@ unsigned char *lpSeek(unsigned char *lp, long index) {
...
@@ -768,10 +768,10 @@ unsigned char *lpSeek(unsigned char *lp, long index) {
if
(
numele
!=
LP_HDR_NUMELE_UNKNOWN
)
{
if
(
numele
!=
LP_HDR_NUMELE_UNKNOWN
)
{
if
(
index
<
0
)
index
=
(
long
)
numele
+
index
;
if
(
index
<
0
)
index
=
(
long
)
numele
+
index
;
if
(
index
<
0
)
return
NULL
;
/* Index still < 0 means out of range. */
if
(
index
<
0
)
return
NULL
;
/* Index still < 0 means out of range. */
if
(
(
long
)
index
>=
numele
)
return
NULL
;
/* Out of range the other side. */
if
(
index
>=
(
long
)
numele
)
return
NULL
;
/* Out of range the other side. */
/* We want to scan right-to-left if the element we are looking for
/* We want to scan right-to-left if the element we are looking for
* is past the half of the listpack. */
* is past the half of the listpack. */
if
(
(
long
)
index
>
numele
/
2
)
{
if
(
index
>
(
long
)
numele
/
2
)
{
forward
=
0
;
forward
=
0
;
/* Right to left scanning always expects a negative index. Convert
/* Right to left scanning always expects a negative index. Convert
* our index to negative form. */
* our index to negative form. */
...
...
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