public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/3] syscall/kcmp*: Convert to new API
Date: Tue, 19 Jul 2016 15:53:49 +0200	[thread overview]
Message-ID: <20160719135349.GE6409@rei.lan> (raw)
In-Reply-To: <1467803450-11622-1-git-send-email-yangx.jy@cn.fujitsu.com>

Hi!
> +static void verify_kcmp(unsigned int n)
>  {
> -	if (fd2 > 0 && close(fd2) < 0)
> -		tst_resm(TWARN | TERRNO, "close fd2 failed");
> -	fd2 = 0;
> -	if (fd3 > 0 && close(fd3) < 0)
> -		tst_resm(TWARN | TERRNO, "close fd3 failed");
> -	fd3 = 0;
> -}
> +	struct test_case *tc = &test_cases[n];
>  
> -static void setup(void)
> -{
> -	if ((tst_kvercmp(3, 5, 0)) < 0) {
> -		tst_brkm(TCONF, NULL,
> -			"This test can only run on kernels that are 3.5. and higher");
> -	}
> +	pid1 = getpid();
>  
> -	tst_tmpdir();
> +	fd1 = SAFE_OPEN(TEST_FILE, O_CREAT | O_RDWR | O_TRUNC);

This SAFE_OPEN() has to be done in the test setup, otherwise it will
start to fail with large enough iteration (-i) parameter once the
maximal number of open files is reached.


The rest looks good.

-- 
Cyril Hrubis
chrubis@suse.cz

  parent reply	other threads:[~2016-07-19 13:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-06 11:10 [LTP] [PATCH 1/3] syscall/kcmp*: Convert to new API Xiao Yang
2016-07-06 11:10 ` [LTP] [PATCH 2/3] lib/cloner.c: Add tst_clone.h for " Xiao Yang
2016-07-19 14:09   ` Cyril Hrubis
2016-07-06 11:10 ` [LTP] [PATCH 3/3] syscalls/kcmp03.c: Add new testcase Xiao Yang
2016-07-19 14:21   ` Cyril Hrubis
2016-07-19 13:53 ` Cyril Hrubis [this message]
2016-07-20  8:21   ` [LTP] [PATCH v2 1/3] syscalls/kcmp*: Convert to new API Xiao Yang
2016-07-20  8:21     ` [LTP] [PATCH v2 2/3] lib/cloner.c: Add tst_clone.h for " Xiao Yang
2016-07-25 15:13       ` Cyril Hrubis
2016-07-20  8:21     ` [LTP] [PATCH v2 3/3] syscalls/kcmp03.c: Add new testcase Xiao Yang
2016-07-25 15:27       ` Cyril Hrubis
2016-07-25 13:55     ` [LTP] [PATCH v2 1/3] syscalls/kcmp*: Convert to new API Cyril Hrubis
  -- strict thread matches above, loose matches on Subject: below --
2016-07-06 10:48 [LTP] [PATCH 1/3] syscall/kcmp*: " Xiao Yang
2016-07-06 11:05 ` Xiao Yang

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=20160719135349.GE6409@rei.lan \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox