提交 e1eccf9a 编写于 作者: A antirez

zmalloc: Make fp var non local to fix build.

上级 945a2f94
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册