All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] syscalls/capget02: Use pid=0 instead of getpid()
Date: Thu, 9 Jan 2020 15:00:17 +0800	[thread overview]
Message-ID: <1578553217-29510-1-git-send-email-xuyang2018.jy@cn.fujitsu.com> (raw)

Since pid=0 returns the capabilities for the calling thread,
we can remove getpid and use pid=0 instead of it. Also we
can cover this test point.

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
---
 testcases/kernel/syscalls/capget/capget02.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/testcases/kernel/syscalls/capget/capget02.c b/testcases/kernel/syscalls/capget/capget02.c
index 42c76a011..0a23700b9 100644
--- a/testcases/kernel/syscalls/capget/capget02.c
+++ b/testcases/kernel/syscalls/capget/capget02.c
@@ -69,15 +69,13 @@ static void verify_capget(unsigned int n)
 
 static void setup(void)
 {
-	unsigned int i, pid;
-
-	pid = getpid();
+	unsigned int i;
 
 	header.version = 0x19980330;
-	header.pid = pid;
+	header.pid = 0;
 
 	bad_version_header.version = 0;
-	bad_version_header.pid = pid;
+	bad_version_header.pid = 0;
 
 	bad_pid_header.version = 0x19980330;
 	bad_pid_header.pid = -1;
-- 
2.18.0




             reply	other threads:[~2020-01-09  7:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-09  7:00 Yang Xu [this message]
2020-01-09  7:24 ` [LTP] [PATCH] syscalls/capget02: Use pid=0 instead of getpid() Yang Xu
2020-01-09  9:59   ` Cyril Hrubis
2020-01-09 10:14     ` Yang Xu
2020-01-10 16:46       ` Petr Vorel
2020-01-13  1:21         ` Yang Xu

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=1578553217-29510-1-git-send-email-xuyang2018.jy@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.