diff options
author | Namhyung Kim <namhyung@kernel.org> | 2015-11-03 06:21:05 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-11-03 10:13:31 -0500 |
commit | 715f8db9102f1ab40ea4a87bedfe86399323698f (patch) | |
tree | f27d829e872223cc6fd0052f0142eda8d55a952c /tools/lib | |
parent | 7a0119468c9c2deff24ef24e1b4d2c1bd1523fd5 (diff) |
tools lib bpf: Fix compiler warning on CentOS 6
CC libbpf.o
cc1: warnings being treated as errors
libbpf.c: In function 'bpf_program__title':
libbpf.c:1037: error: declaration of 'dup' shadows a global declaration
/usr/include/unistd.h:528: error: shadowed declaration is here
mv: cannot stat `./.libbpf.o.tmp': No such file or directory
make[3]: *** [libbpf.o] Error 1
make[2]: *** [libbpf-in.o] Error 2
make[1]: *** [/linux/tools/lib/bpf/libbpf.a] Error 2
make[1]: *** Waiting for unfinished jobs....
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1446549665-2342-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/bpf/libbpf.c | 4 | ||||
-rw-r--r-- | tools/lib/bpf/libbpf.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 4252fc22f78f..9f3c8cf9249b 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c | |||
@@ -1034,12 +1034,12 @@ int bpf_program__get_private(struct bpf_program *prog, void **ppriv) | |||
1034 | return 0; | 1034 | return 0; |
1035 | } | 1035 | } |
1036 | 1036 | ||
1037 | const char *bpf_program__title(struct bpf_program *prog, bool dup) | 1037 | const char *bpf_program__title(struct bpf_program *prog, bool needs_copy) |
1038 | { | 1038 | { |
1039 | const char *title; | 1039 | const char *title; |
1040 | 1040 | ||
1041 | title = prog->section_name; | 1041 | title = prog->section_name; |
1042 | if (dup) { | 1042 | if (needs_copy) { |
1043 | title = strdup(title); | 1043 | title = strdup(title); |
1044 | if (!title) { | 1044 | if (!title) { |
1045 | pr_warning("failed to strdup program title\n"); | 1045 | pr_warning("failed to strdup program title\n"); |
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h index f16170c95ffd..bc80af03c6f4 100644 --- a/tools/lib/bpf/libbpf.h +++ b/tools/lib/bpf/libbpf.h | |||
@@ -63,7 +63,7 @@ int bpf_program__set_private(struct bpf_program *prog, void *priv, | |||
63 | int bpf_program__get_private(struct bpf_program *prog, | 63 | int bpf_program__get_private(struct bpf_program *prog, |
64 | void **ppriv); | 64 | void **ppriv); |
65 | 65 | ||
66 | const char *bpf_program__title(struct bpf_program *prog, bool dup); | 66 | const char *bpf_program__title(struct bpf_program *prog, bool needs_copy); |
67 | 67 | ||
68 | int bpf_program__fd(struct bpf_program *prog); | 68 | int bpf_program__fd(struct bpf_program *prog); |
69 | 69 | ||