[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aWZrbRhat5mw1tnl@desktop.y-koj.net>
Date: Wed, 14 Jan 2026 00:57:33 +0900
From: Yohei Kojima <yk@...oj.net>
To: Markus Elfring <Markus.Elfring@....de>
Cc: linux-kselftest@...r.kernel.org, netdev@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>,
Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>, Shuah Khan <shuah@...nel.org>
Subject: Re: [PATCH net-next v2 2/2] selftests: net: improve error handling
in passive TFO test
On Tue, Jan 13, 2026 at 03:48:11PM +0100, Markus Elfring wrote:
> …
> > +++ b/tools/testing/selftests/net/tfo.c
> > @@ -82,8 +82,10 @@ static void run_server(void)
> …
> > if (read(connfd, buf, 64) < 0)
> > - perror("read()");
> > - fprintf(outfile, "%d\n", opt);
> > + error(1, errno, "read()");
> > +
> > + if (fprintf(outfile, "%d\n", opt) < 0)
> > + error(1, errno, "fprintf()");
> >
> > fclose(outfile);
> > close(connfd);
> …
>
> Why was error detection omitted for close() calls here so far?
Because I believe that checking the return value of fclose() would not
provide additional value in this test case, which is focused on testing
the behavior of passive TFO.
I understand that fclose() could fail there, but considering the
trade-off between test reliability and code complexity (which increases
review and maintenance costs), I think checking the return value there
does not provide benefits to justify the added complexity. In fact, as
far as I can see, none of the existing tests in selftests/net check the
fclose() return value.
Thank you,
Yohei
>
> https://pubs.opengroup.org/onlinepubs/9799919799/functions/fclose.html
>
> Regards,
> Markus
Powered by blists - more mailing lists