Linux Test Project
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] syscalls/getdents01: Add close() and open() at the end of run()
Date: Fri, 23 Apr 2021 15:43:28 +0200	[thread overview]
Message-ID: <YILPAKuBw2B8Z52d@yuki> (raw)
In-Reply-To: <20210423095929.5280-1-zhaogongyi@huawei.com>

Hi!
>  testcases/kernel/syscalls/getdents/getdents01.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/testcases/kernel/syscalls/getdents/getdents01.c b/testcases/kernel/syscalls/getdents/getdents01.c
> index ef8f4e864..7982691a6 100644
> --- a/testcases/kernel/syscalls/getdents/getdents01.c
> +++ b/testcases/kernel/syscalls/getdents/getdents01.c
> @@ -92,6 +92,9 @@ static void run(void)
>  	} while (rval > 0);
> 
>  	check_flags();
> +
> +	SAFE_CLOSE(fd);
> +	fd = SAFE_OPEN(".", O_RDONLY|O_DIRECTORY);
>  }

Good catch but I guess that it would be a bit cleaner if we opened the
fd at the start of the run() and closed it at the end instead of opening
it in setup() and reopening it for each iteration.

-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2021-04-23 13:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-23  9:59 [LTP] [PATCH] syscalls/getdents01: Add close() and open() at the end of run() Zhao Gongyi
2021-04-23 13:43 ` Cyril Hrubis [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-04-25  3:28 zhaogongyi

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=YILPAKuBw2B8Z52d@yuki \
    --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