From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 2/2] syscalls/getppid02: Convert to the new API
Date: Tue, 16 Mar 2021 17:37:18 +0100 [thread overview]
Message-ID: <YFDevk/wNwd3epod@pevik> (raw)
In-Reply-To: <20210304021304.1126635-2-ruansy.fnst@fujitsu.com>
Hi Ruan,
> The logic is same as syscalls/getpid02, which is to check whether
> parent's pid equals child's ppid.
...
> - for (lc = 0; TEST_LOOPING(lc); lc++) {
> - tst_count = 0;
> -
> - ppid = getpid();
> - pid = FORK_OR_VFORK();
> - if (pid == -1)
> - tst_brkm(TBROK, cleanup, "fork failed");
> -
> - if (pid == 0) {
> - TEST(getppid());
> -
> - if (TEST_RETURN != ppid)
> - errx(1, "getppid failed (%ld != %d)",
> - TEST_RETURN, ppid);
> - else
> - printf("return value and parent's pid "
> - "value match\n");
> - exit(0);
> - } else {
> - SAFE_WAIT(cleanup, &status);
> - if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
> - tst_resm(TFAIL,
> - "getppid functionality incorrect");
> - }
Right, else part is safe to drop as it's being tested in fork_testrun(void).
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Kind regards,
Petr
next prev parent reply other threads:[~2021-03-16 16:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-04 2:13 [LTP] [PATCH 1/2] syscalls/getppid01: Convert to the new API Shiyang Ruan
2021-03-04 2:13 ` [LTP] [PATCH 2/2] syscalls/getppid02: " Shiyang Ruan
2021-03-16 16:37 ` Petr Vorel [this message]
2021-03-16 16:40 ` Petr Vorel
2021-03-17 9:01 ` ruansy.fnst
2021-03-17 9:19 ` Petr Vorel
2021-04-23 14:43 ` Cyril Hrubis
2021-03-16 16:43 ` [LTP] [PATCH 1/2] syscalls/getppid01: " Petr Vorel
2021-04-23 14:39 ` Cyril Hrubis
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=YFDevk/wNwd3epod@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