Thread (8 messages) 8 messages, 3 authors, 2026-01-19

Re: [PATCH net-next v2 2/2] selftests: net: improve error handling in passive TFO test

From: Markus Elfring <hidden>
Date: 2026-01-13 14:48:28
Also in: linux-kselftest, lkml

quoted hunk ↗ jump to hunk
+++ 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?

https://pubs.opengroup.org/onlinepubs/9799919799/functions/fclose.html

Regards,
Markus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help