public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] [COMMITTED] [PATCH] syscalls/prctl07: Fix build.
Date: Mon, 22 Jul 2019 14:05:23 +0800	[thread overview]
Message-ID: <5D355223.5040705@cn.fujitsu.com> (raw)
In-Reply-To: <20190716143238.483-1-chrubis@suse.cz>


> Ideally this is last fix for prctl07.
>
> Since I've changed the check_proc_capamb() to use macro definition
> instead of raw integer value we depend on sys/capability.h being
> included to compile the code.
>
> So this commit changes:
>
> The sys/capability.h is included under HAVE_SYS_CAPABILITY_H now and so
> the function is ifdefed out if we don't have that header.
>
> Also it looks like HAVE_LIBCAP is not defined unless libcap supports
> cap_compare() which should be fixed. The check for libcap and
> cap_compare() has to be uncoupled but that has to be done in a sepratate
> patch.
Hi Cyril

     I have a patch for this on 2019.5 [1] but not correct way.  Also, I am going to simpify and remove some m4.
I will uncouple libcap and cap_compare in ltp-cap.m4.

[1]http://lists.linux.it/pipermail/ltp/2019-May/011925.html

> Signed-off-by: Cyril Hrubis<chrubis@suse.cz>
> ---
>   testcases/kernel/syscalls/prctl/prctl07.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/prctl/prctl07.c b/testcases/kernel/syscalls/prctl/prctl07.c
> index 37d77df33..79f7710a8 100644
> --- a/testcases/kernel/syscalls/prctl/prctl07.c
> +++ b/testcases/kernel/syscalls/prctl/prctl07.c
> @@ -25,7 +25,7 @@
>   #include<sys/prctl.h>
>   #include<stdlib.h>
>   #include "config.h"
> -#ifdef HAVE_LIBCAP
> +#ifdef HAVE_SYS_CAPABILITY_H
>   # include<sys/capability.h>
>   #endif
>   #include "lapi/syscalls.h"
> @@ -35,7 +35,8 @@
>
>   #define PROC_STATUS "/proc/self/status"
>
> -static inline void check_proc_capamb(char *message, int flag)
> +#ifdef HAVE_SYS_CAPABILITY_H
> +static void check_proc_capamb(char *message, int flag)
>   {
>   	int cap_num;
>   	char CapAmb[20];
> @@ -62,6 +63,7 @@ static inline void check_proc_capamb(char *message, int flag)
>   			"%s, CapAmb in %s doesn't have CAP_NET_BIND_SERVICE",
>   			message, PROC_STATUS);
>   }
> +#endif
>
>   static inline void check_cap_raise(unsigned int cap, char *message, int fail_flag)
>   {




      reply	other threads:[~2019-07-22  6:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-16 14:32 [LTP] [COMMITTED] [PATCH] syscalls/prctl07: Fix build Cyril Hrubis
2019-07-22  6:05 ` Yang Xu [this message]

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=5D355223.5040705@cn.fujitsu.com \
    --to=xuyang2018.jy@cn.fujitsu.com \
    --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