From: Wanlong Gao <gaowanlong@cn.fujitsu.com>
To: Honggyu Kim <nexus226@gmail.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH v3] acct01: fix TBROK to TCONF if acct not implemented
Date: Mon, 04 Nov 2013 09:26:27 +0800 [thread overview]
Message-ID: <5276F7C3.4080606@cn.fujitsu.com> (raw)
In-Reply-To: <1383466482-19441-1-git-send-email-nexus226@gmail.com>
On 11/03/2013 04:14 PM, Honggyu Kim wrote:
> acct system call is avaliable only when the kernel option is on.
> When it fails, acct returns -1 and sets errno correspondingly.
> ENOSYS is set when the system call is not implemented.
> Currently, ENOSYS is not checked when the TEST_FILE5 argument is passed.
> It just goes to TBROK regardless of the implementation in kernel.
> This patch modifies to check errno ENOSYS, and marks as TCONF in that case.
What's changed from V2 to V3?
Thanks,
Wanlong Gao
>
> Signed-off-by: Honggyu Kim <nexus226@gmail.com>
> ---
> testcases/kernel/syscalls/acct/acct01.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/acct/acct01.c b/testcases/kernel/syscalls/acct/acct01.c
> index c38d4db..0fe973b 100644
> --- a/testcases/kernel/syscalls/acct/acct01.c
> +++ b/testcases/kernel/syscalls/acct/acct01.c
> @@ -103,8 +103,15 @@ static void setup(void)
> fd = SAFE_CREAT(cleanup, TEST_FILE5, 0777);
> SAFE_CLOSE(cleanup, fd);
>
> - if (acct(TEST_FILE5) == -1)
> - tst_brkm(TBROK | TERRNO, cleanup, "acct failed unexpectedly");
> + if (acct(TEST_FILE5) == -1) {
> + if (errno == ENOSYS) {
> + tst_brkm(TCONF, cleanup,
> + "BSD process accounting is not configured in "
> + "this kernel");
> + } else {
> + tst_brkm(TBROK | TERRNO, cleanup, "acct failed unexpectedly");
> + }
> + }
>
> /* turn off acct, so we are in a known state */
> if (acct(NULL) == -1) {
>
------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2013-11-04 1:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-03 8:14 [LTP] [PATCH v3] acct01: fix TBROK to TCONF if acct not implemented Honggyu Kim
2013-11-04 1:26 ` Wanlong Gao [this message]
[not found] ` <CAEcr6y0OmaAyEiTwicvpF7cuHx_GNC+QrU5wPmAwD-1SGwZLRw@mail.gmail.com>
2013-11-04 2:39 ` Wanlong Gao
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=5276F7C3.4080606@cn.fujitsu.com \
--to=gaowanlong@cn.fujitsu.com \
--cc=ltp-list@lists.sourceforge.net \
--cc=nexus226@gmail.com \
/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