[PATCH 01/19] perf config: Fix build with older toolchain.

From: Arnaldo Carvalho de Melo
Date: Thu Apr 07 2016 - 17:03:13 EST


From: Vinson Lee <vlee@xxxxxxxxxxxxxxx>

Fix build error on Ubuntu 12.04.5 with GCC 4.6.3.

CC util/config.o
util/config.c: In function âperf_buildid_configâ:
util/config.c:384:15: error: declaration of âdirnameâ shadows a global declaration [-Werror=shadow]

Signed-off-by: Vinson Lee <vlee@xxxxxxxxxxxxxxx>
Cc: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
Cc: Alexei Starovoitov <ast@xxxxxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Taeung Song <treeze.taeung@xxxxxxxxx>
Cc: Wang Nan <wangnan0@xxxxxxxxxx>
Fixes: 9cb5987c8227 ("perf config: Rework buildid_dir_command_config to perf_buildid_config")
Link: http://lkml.kernel.org/r/1459807659-9020-1-git-send-email-vlee@xxxxxxxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/util/config.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/config.c b/tools/perf/util/config.c
index 5c20d783423b..664490b8b327 100644
--- a/tools/perf/util/config.c
+++ b/tools/perf/util/config.c
@@ -381,11 +381,11 @@ static int perf_buildid_config(const char *var, const char *value)
{
/* same dir for all commands */
if (!strcmp(var, "buildid.dir")) {
- const char *dirname = perf_config_dirname(var, value);
+ const char *dir = perf_config_dirname(var, value);

- if (!dirname)
+ if (!dir)
return -1;
- strncpy(buildid_dir, dirname, MAXPATHLEN-1);
+ strncpy(buildid_dir, dir, MAXPATHLEN-1);
buildid_dir[MAXPATHLEN-1] = '\0';
}

--
2.5.5