2022-04-15 22:08:40

by Alexander Lobakin

[permalink] [raw]
Subject: [PATCH bpf-next 06/11] tools, bpf: fix fcntl.h include in bpftool

Fix the following (on some libc implementations):

CC tracelog.o
In file included from tracelog.c:12:
include/sys/fcntl.h:1:2: warning: #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h> [-Wcpp]
1 | #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h>
| ^~~~~~~

<sys/fcntl.h> is anyway just a wrapper over <fcntl.h> (backcomp
stuff).

Fixes: 30da46b5dc3a ("tools: bpftool: add a command to dump the trace pipe")
Signed-off-by: Alexander Lobakin <[email protected]>
---
tools/bpf/bpftool/tracelog.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/bpf/bpftool/tracelog.c b/tools/bpf/bpftool/tracelog.c
index e80a5c79b38f..bf1f02212797 100644
--- a/tools/bpf/bpftool/tracelog.c
+++ b/tools/bpf/bpftool/tracelog.c
@@ -9,7 +9,7 @@
#include <string.h>
#include <unistd.h>
#include <linux/magic.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
#include <sys/vfs.h>

#include "main.h"
--
2.35.2



2022-04-16 00:47:20

by Song Liu

[permalink] [raw]
Subject: Re: [PATCH bpf-next 06/11] tools, bpf: fix fcntl.h include in bpftool

On Thu, Apr 14, 2022 at 3:46 PM Alexander Lobakin <[email protected]> wrote:
>
> Fix the following (on some libc implementations):
>
> CC tracelog.o
> In file included from tracelog.c:12:
> include/sys/fcntl.h:1:2: warning: #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h> [-Wcpp]
> 1 | #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h>
> | ^~~~~~~
>
> <sys/fcntl.h> is anyway just a wrapper over <fcntl.h> (backcomp
> stuff).
>
> Fixes: 30da46b5dc3a ("tools: bpftool: add a command to dump the trace pipe")
> Signed-off-by: Alexander Lobakin <[email protected]>

Acked-by: Song Liu <[email protected]>

> ---
> tools/bpf/bpftool/tracelog.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/bpf/bpftool/tracelog.c b/tools/bpf/bpftool/tracelog.c
> index e80a5c79b38f..bf1f02212797 100644
> --- a/tools/bpf/bpftool/tracelog.c
> +++ b/tools/bpf/bpftool/tracelog.c
> @@ -9,7 +9,7 @@
> #include <string.h>
> #include <unistd.h>
> #include <linux/magic.h>
> -#include <sys/fcntl.h>
> +#include <fcntl.h>
> #include <sys/vfs.h>
>
> #include "main.h"
> --
> 2.35.2
>
>