From: Petr Vorel <pvorel@suse.cz>
To: Li Wang <wangli.ahau@gmail.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2] close: add test for double close EBADF
Date: Mon, 13 Apr 2026 13:30:02 +0200 [thread overview]
Message-ID: <20260413113002.GB219073@pevik> (raw)
In-Reply-To: <CAE1O6mgFhsT0XP33=8Ji5dJPS5d27Oz8A74wWckcDX0c4LVHxQ@mail.gmail.com>
Hi all,
...
> > +static void verify_close(unsigned int i)
> > {
> > - TST_EXP_FAIL(close(-1), EBADF);
> > + int fd;
> > + struct tcase *tc = &tcases[i];
> > +
> > + switch (tc->type) {
> > + case INVALID_FD:
> > + TST_EXP_FAIL(close(-1), EBADF, "%s", tc->desc);
> > + break;
> > +
> > + case DOUBLE_CLOSE:
> > + fd = SAFE_OPEN("close02", O_CREAT, 0600);
> According to the open(2) man page, the flags argument must include one
> of the access modes: O_RDONLY, O_WRONLY, or O_RDWR.
Good catch, Li.
> For example:
> fd = SAFE_OPEN("close02", O_CREAT | O_RDWR, 0600);
> With the flag updated to include an access mode (like O_RDWR),
> it will look good to me:
> Reviewed-by: Li Wang <wangli.ahau@gmail.com>
Agree.
Reviewed-by: Petr Vorel <pvorel@suse.cz>
And welcome back. Feel free to update .mailmap to the new address.
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-04-13 11:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-06 13:30 [LTP] [PATCH 1/2] close: remove unused headers and fix minor style issues Jinseok Kim
2026-04-06 13:31 ` [LTP] [PATCH 2/2] close: add test for double close EBADF Jinseok Kim
2026-04-09 8:15 ` Petr Vorel
2026-04-11 11:04 ` [LTP] [PATCH v2] " Jinseok Kim
2026-04-13 4:33 ` Li Wang
2026-04-13 11:30 ` Petr Vorel [this message]
2026-04-13 16:52 ` [LTP] [PATCH v3] " Jinseok Kim
2026-04-13 18:04 ` [LTP] " linuxtestproject.agent
2026-04-13 20:45 ` [LTP] [PATCH v3] " Petr Vorel
2026-04-09 8:08 ` [LTP] [PATCH 1/2] close: remove unused headers and fix minor style issues Petr Vorel
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=20260413113002.GB219073@pevik \
--to=pvorel@suse.cz \
--cc=ltp@lists.linux.it \
--cc=wangli.ahau@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