mirror of
https://github.com/fluencelabs/redis
synced 2025-03-20 17:40:50 +00:00
zmalloc: Make fp var non local to fix build.
This commit is contained in:
parent
945a2f948e
commit
e1eccf9a6b
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user