[LTP] [PATCH v4] syscalls/pidfd_open01.c: Add check for close-on-exec flag

Viresh Kumar viresh.kumar@linaro.org
Mon Jul 20 10:53:11 CEST 2020


On 20-07-20, 13:27, Xiao Yang wrote:
> pidfd_open(2) will set close-on-exec flag on the file descriptor as
> it manpage states, so check close-on-exec flag by fcntl(2).
> 
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
> ---
> 
> 1) We don't care if the test uses the TEST() macro so just keep it.
> 2) Use bare fcntl() instead of SAFE_FCNTL() so that file descriptor
>    can be closed when fcntl(F_GETFD) fails.
> 
>  .../kernel/syscalls/pidfd_open/pidfd_open01.c  | 18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh


More information about the ltp mailing list