From: Cyril Hrubis <chrubis@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v1 2/2] Refactor pidns04 test using new LTP API
Date: Fri, 5 Aug 2022 15:05:26 +0200 [thread overview]
Message-ID: <Yu0VlowxwufSYbWw@yuki> (raw)
In-Reply-To: <20220804133015.15150-2-andrea.cervesato@suse.com>
Hi!
> -static void cleanup(void)
> +static void run(void)
> {
> - close(fd[0]);
> + int ret;
> +
> + ret = ltp_clone_quick(CLONE_NEWPID | SIGCHLD, child_func, NULL);
> + if (ret < 0)
> + tst_brk(TBROK | TERRNO, "clone failed");
I think that it may be cleaner to wait() the child here since if we
manage to kill the child the test will end up with:
tst_test.c:381: TBROK: Child (26434) killed by signal SIGKILL
so maybe add:
SAFE_WAITPID(ret, &status, 0);
if (WIFEXITTED(status) && WEXITSTATUS(status) == 0)
return;
if (WIFSIGNALED(status) && WTERMSIG(status) == SIGKILL) {
tst_res(TFAIL, "Child killed by SIGKILL");
return;
}
tst_res(TBROK, "Child %s", tst_strstatus(status));
But maybe the clearer message is not worth the effort here.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2022-08-05 13:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-04 13:30 [LTP] [PATCH v1 1/2] Refactor pidns03 test using new LTP API Andrea Cervesato via ltp
2022-08-04 13:30 ` [LTP] [PATCH v1 2/2] Refactor pidns04 " Andrea Cervesato via ltp
2022-08-05 13:05 ` Cyril Hrubis [this message]
2022-08-05 13:01 ` [LTP] [PATCH v1 1/2] Refactor pidns03 " 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=Yu0VlowxwufSYbWw@yuki \
--to=chrubis@suse.cz \
--cc=andrea.cervesato@suse.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