From: Andrea Cervesato via ltp <ltp@lists.linux.it>
To: Petr Vorel <pvorel@suse.cz>, Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2 2/2] Add shutdown02 test
Date: Mon, 10 Jun 2024 16:07:03 +0200 [thread overview]
Message-ID: <84c8b7fb-cdb1-4238-bfe7-e2be5592a17d@suse.com> (raw)
In-Reply-To: <20240610134434.GA746646@pevik>
Hi Petr,
On 6/10/24 15:44, Petr Vorel wrote:
> Hi Andrea,
>
> ...
>> +static int file_desc = -1;
>> +static int valid_sock = -1;
>> +static int invalid_sock = -1;
> FYI many LTP tests (or even lib/tst_cgroup.c) just expect that 0 is for stdin,
> thus they happily expect 0 is invalid). e.g.
>
> static int file_desc;
>
> Then in cleanup:
> if (valid_sock > 0)
> SAFE_CLOSE(valid_sock);
>
> Sure, your way is correct, but I'd be also OK with 0.
>
> (SAFE_SOCKET() and SAFE_CLOSE() also checks it should be >= 0 for valid file
> descriptor or just -1 for error).
>
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
>
> Kind regards,
> Petr
I will fix it now
Andrea
--
Mailing list info: https://lists.linux.it/listinfo/ltp
prev parent reply other threads:[~2024-06-10 14:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-07 8:13 [LTP] [PATCH v2 0/2] shutdown testing suite Andrea Cervesato
2024-06-07 8:13 ` [LTP] [PATCH v2 1/2] Add shutdown01 test Andrea Cervesato
2024-06-10 13:13 ` Petr Vorel
2024-06-10 13:17 ` Andrea Cervesato via ltp
2024-06-10 13:52 ` Petr Vorel
2024-06-07 8:13 ` [LTP] [PATCH v2 2/2] Add shutdown02 test Andrea Cervesato
2024-06-10 13:44 ` Petr Vorel
2024-06-10 14:07 ` Andrea Cervesato via ltp [this message]
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=84c8b7fb-cdb1-4238-bfe7-e2be5592a17d@suse.com \
--to=ltp@lists.linux.it \
--cc=andrea.cervesato@suse.com \
--cc=andrea.cervesato@suse.de \
--cc=pvorel@suse.cz \
/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