From 3cb432837ce799062c83337e5f590c385e48d4bd Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 21 Nov 2012 13:17:38 +0100 Subject: [PATCH] Use more fine grained HAVE macros instead of HAVE_PROCFS. --- src/config.h | 4 +++- src/zmalloc.c | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/config.h b/src/config.h index db33407c..97c59974 100644 --- a/src/config.h +++ b/src/config.h @@ -45,7 +45,9 @@ /* Test for proc filesystem */ #ifdef __linux__ -#define HAVE_PROCFS 1 +#define HAVE_PROC_STAT 1 +#define HAVE_PROC_MAPS 1 +#define HAVE_PROC_SMAPS 1 #endif /* Test for task_info() */ diff --git a/src/zmalloc.c b/src/zmalloc.c index 1f8c7f08..a9ba0943 100644 --- a/src/zmalloc.c +++ b/src/zmalloc.c @@ -252,7 +252,7 @@ void zmalloc_set_oom_handler(void (*oom_handler)(size_t)) { * function RedisEstimateRSS() that is a much faster (and less precise) * version of the funciton. */ -#if defined(HAVE_PROCFS) +#if defined(HAVE_PROC_STAT) #include #include #include @@ -325,7 +325,7 @@ float zmalloc_get_fragmentation_ratio(void) { return (float)zmalloc_get_rss()/zmalloc_used_memory(); } -#if defined(HAVE_PROCFS) +#if defined(HAVE_PROC_SMAPS) size_t zmalloc_get_private_dirty(void) { char line[1024]; size_t pd = 0; -- 2.45.2