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
e1eccf9a
Commit
e1eccf9a
authored
Sep 19, 2016
by
antirez
Browse files
zmalloc: Make fp var non local to fix build.
parent
945a2f94
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/zmalloc.c
View file @
e1eccf9a
...
...
@@ -315,13 +315,14 @@ size_t zmalloc_get_smap_bytes_by_field(char *field, long pid) {
char
line
[
1024
];
size_t
bytes
=
0
;
int
flen
=
strlen
(
field
);
FILE
*
fp
;
if
(
pid
==
-
1
)
{
FILE
*
fp
=
fopen
(
"/proc/self/smaps"
,
"r"
);
fp
=
fopen
(
"/proc/self/smaps"
,
"r"
);
}
else
{
char
filename
[
128
];
snprintf
(
filename
,
sizeof
(
filename
),
"/proc/%ld/smaps"
,
pid
);
FILE
*
fp
=
fopen
(
filename
,
"r"
);
fp
=
fopen
(
filename
,
"r"
);
}
if
(
!
fp
)
return
0
;
...
...
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