From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 3/3] syscalls: Remove unused include <fcntl.h>
Date: Wed, 13 Jan 2021 10:54:59 +0100 [thread overview]
Message-ID: <X/7Dc2cb730/RtJy@pevik> (raw)
In-Reply-To: <5FFEBA89.5040001@cn.fujitsu.com>
> On 2021/1/13 15:51, Petr Vorel wrote:
> > Tests should always use lapi/fcntl.h instead of <fcntl.h> to fix
> > possible missing definitions.
> > But in this case removing include, because fanotify tests include
> > <fcntl.h> in lapi/fcntl.h (via fanotify.h) and
> > {name_to,open_by}_handle_at tests include lapi/fcntl.h in
> > lapi/name_to_handle_at.h.
> Hi Petr,
> This patchset looks good to me.
> Reviewed-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
> Only one monir question:
> Why do we remove <fcntl.h> header for all fanotify tests?
> Of course, just four fanotify tests take use of struct file_handle.
I thought I was clear in the commit description, but obviously I wasn't.
Previous commit adds lapi/fcntl.h to fanotify.h. And lapi/fcntl.h loads
<fcntl.h>, thus it's not needed here.
There has been a discussion in the past whether include "original" headers (e.g.
<fcntl.h>) in lapi headers (e.g. lapi/fcntl.h). I suggested to always include
this header, because we often don't test in Travis these corner cases when
things get broken due some definition missing. It's just safer to always use
lapi header. Previously lapi header was loaded only "when needed", but it gets
broken on less common libc (all but glibc) or on less common archs.
And it does not make sense to load "original" header and then lapi header.
If I remember correctly we agreed on this, but older lapi headers use the old
approach. I might send a patch to cleanup this and document it so we use the
same approach.
Kind regards,
Petr
> Best Regards,
> Xiao Yang
next prev parent reply other threads:[~2021-01-13 9:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-13 7:51 [LTP] [PATCH v2 0/3] Build fix undefined struct file_handle Petr Vorel
2021-01-13 7:51 ` [LTP] [PATCH v2 1/3] lapi: Move struct file_handle into lapi/fcntl.h Petr Vorel
2021-01-13 8:19 ` Yang Xu
2021-01-13 8:36 ` Petr Vorel
2021-01-13 8:51 ` Yang Xu
2021-01-13 7:51 ` [LTP] [PATCH v2 2/3] fanotify: Fix build on undefined struct file_handle Petr Vorel
2021-01-13 7:51 ` [LTP] [PATCH v2 3/3] syscalls: Remove unused include <fcntl.h> Petr Vorel
2021-01-13 9:16 ` Xiao Yang
2021-01-13 9:20 ` Xiao Yang
2021-01-13 10:02 ` Petr Vorel
2021-01-13 9:54 ` Petr Vorel [this message]
2021-01-13 9:57 ` [LTP] [PATCH v2 0/3] Build fix undefined struct file_handle Cyril Hrubis
2021-01-13 10:11 ` Petr Vorel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=X/7Dc2cb730/RtJy@pevik \
--to=pvorel@suse.cz \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox