From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH V2 1/4] waitpid06: use the new API
Date: Wed, 3 Aug 2016 18:01:36 +0200 [thread overview]
Message-ID: <20160803160136.GD25589@rei> (raw)
In-Reply-To: <1468940141-4342-1-git-send-email-stanislav.kholmanskikh@oracle.com>
Hi!
This version looks very good, a few minor comment below.
> + if (reap_children(-1, 0, fork_kid_pid, MAXKIDS)) {
> + tst_res(TFAIL, "reap_children() failed");
> + return;
> }
We already failed the test in the reap_children(), so this message is
redundand and we can just return here.
> +static void waitpid_test(void)
> +{
> + int status;
> +
> + child_1_pid = SAFE_FORK();
> + if (child_1_pid == 0) {
> + do_child_1();
> + } else {
> + SAFE_WAITPID(child_1_pid, &status, 0);
> +
> + child_1_pid = 0;
> +
> + if (!WIFEXITED(status))
> + tst_brk(TBROK, "Child 1 exited abnormally");
> +
> + if (WEXITSTATUS(status) != 0)
> + tst_res(TFAIL, "Child 1 returned bad status");
This does not correctly propagate TBROK.
What we should do here is similar to the check_child_status() in the
tst_test.c.
I guess that the best course of action would be renaming reap_children()
to tst_reap_children() and remove static so that we can use it in the
tests as well.
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2016-08-03 16:01 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-15 14:39 [LTP] waitpid: new API Stanislav Kholmanskikh
2016-07-15 14:39 ` [LTP] [PATCH 1/8] tst_safe_macros: SAFE_GETPGID Stanislav Kholmanskikh
2016-07-15 14:39 ` [LTP] [PATCH 2/8] waitpid06: use the new API Stanislav Kholmanskikh
2016-07-18 13:05 ` Cyril Hrubis
2016-07-19 14:55 ` [LTP] [PATCH V2 1/4] " Stanislav Kholmanskikh
2016-07-19 14:55 ` [LTP] [PATCH V2 2/4] waitpid07: " Stanislav Kholmanskikh
2016-07-19 14:55 ` [LTP] [PATCH V2 3/4] waitpid08: " Stanislav Kholmanskikh
2016-07-19 14:55 ` [LTP] [PATCH V2 4/4] waitpid11: " Stanislav Kholmanskikh
2016-08-03 16:12 ` [LTP] [PATCH V2 2/4] waitpid07: " Cyril Hrubis
2016-08-03 16:01 ` Cyril Hrubis [this message]
2016-08-03 10:19 ` [LTP] [PATCH 2/8] waitpid06: " Stanislav Kholmanskikh
2016-08-03 12:01 ` Cyril Hrubis
2016-07-15 14:39 ` [LTP] [PATCH 3/8] waitpid07: " Stanislav Kholmanskikh
2016-07-15 14:39 ` [LTP] [PATCH 4/8] waitpid09: " Stanislav Kholmanskikh
2016-07-18 14:18 ` Cyril Hrubis
2016-07-19 10:34 ` [LTP] [PATCH V2 " Stanislav Kholmanskikh
2016-07-19 12:41 ` Cyril Hrubis
2016-07-19 14:57 ` Stanislav Kholmanskikh
2016-07-15 14:39 ` [LTP] [PATCH 5/8] waitpid11: " Stanislav Kholmanskikh
2016-07-18 15:01 ` Cyril Hrubis
2016-07-15 14:39 ` [LTP] [PATCH 6/8] waitpid12: " Stanislav Kholmanskikh
2016-07-18 15:07 ` Cyril Hrubis
2016-07-15 14:39 ` [LTP] [PATCH 7/8] waitpid13: " Stanislav Kholmanskikh
2016-07-15 14:39 ` [LTP] [PATCH 8/8] waitpid08: " Stanislav Kholmanskikh
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=20160803160136.GD25589@rei \
--to=chrubis@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 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.