Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1261575

Re: [PATCH] tools/lib/bpf: Fix compiler warning on CentOS 6

From Arnaldo Carvalho de Melo <acme@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] tools/lib/bpf: Fix compiler warning on CentOS 6
Date 2015-11-03 16:20 +0100
Message-ID <qqLxo-4or-9@gated-at.bofh.it> (permalink)
References <qqHWO-23s-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Em Tue, Nov 03, 2015 at 08:21:05PM +0900, Namhyung Kim escreveu:
>     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....

Thanks, applied.

- Arnaldo
 
> Cc: Wang Nan <wangnan0@huawei.com>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
>  tools/lib/bpf/libbpf.c | 4 ++--
>  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)
>  	return 0;
>  }
>  
> -const char *bpf_program__title(struct bpf_program *prog, bool dup)
> +const char *bpf_program__title(struct bpf_program *prog, bool needs_copy)
>  {
>  	const char *title;
>  
>  	title = prog->section_name;
> -	if (dup) {
> +	if (needs_copy) {
>  		title = strdup(title);
>  		if (!title) {
>  			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,
>  int bpf_program__get_private(struct bpf_program *prog,
>  			     void **ppriv);
>  
> -const char *bpf_program__title(struct bpf_program *prog, bool dup);
> +const char *bpf_program__title(struct bpf_program *prog, bool needs_copy);
>  
>  int bpf_program__fd(struct bpf_program *prog);
>  
> -- 
> 2.6.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] tools/lib/bpf: Fix compiler warning on CentOS 6 Namhyung Kim <namhyung@kernel.org> - 2015-11-03 12:30 +0100
  Re: [PATCH] tools/lib/bpf: Fix compiler warning on CentOS 6 Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-11-03 16:20 +0100
  [tip:perf/urgent] tools lib bpf: Fix compiler warning on CentOS 6 tip-bot for Namhyung Kim <tipbot@zytor.com> - 2015-11-08 08:30 +0100

csiph-web