diff options
author | antirez <antirez@gmail.com> | 2016-09-19 10:34:39 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2016-09-19 10:34:39 +0200 |
commit | e1eccf9a6be88c93b71e28f24ad7e14bef434142 (patch) | |
tree | 20400b424353a1ecc157cb4986ac03e8f6f90043 /src | |
parent | 945a2f948eb518090325b0ceab92588a905e0f92 (diff) | |
download | redis-e1eccf9a6be88c93b71e28f24ad7e14bef434142.tar.gz |
zmalloc: Make fp var non local to fix build.
Diffstat (limited to 'src')
-rw-r--r-- | src/zmalloc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/zmalloc.c b/src/zmalloc.c index 367258746..22bf84fce 100644 --- a/src/zmalloc.c +++ b/src/zmalloc.c @@ -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; |