Skip to content

Commit 91dc09a

Browse files
groeckkuba-moo
authored andcommitted
selftests: net: tfo: Fix build warning
Fix tfo.c: In function ‘run_server’: tfo.c:84:9: warning: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’ by evaluating the return value from read() and displaying an error message if it reports an error. Fixes: c65b5bb ("selftests: net: add passive TFO test binary") Cc: David Wei <dw@davidwei.uk> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Link: https://patch.msgid.link/20251205171010.515236-14-linux@roeck-us.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 59546e8 commit 91dc09a

File tree

1 file changed

+2
-1
lines changed
  • tools/testing/selftests/net

1 file changed

+2
-1
lines changed

tools/testing/selftests/net/tfo.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ static void run_server(void)
8181
if (getsockopt(connfd, SOL_SOCKET, SO_INCOMING_NAPI_ID, &opt, &len) < 0)
8282
error(1, errno, "getsockopt(SO_INCOMING_NAPI_ID)");
8383

84-
read(connfd, buf, 64);
84+
if (read(connfd, buf, 64) < 0)
85+
perror("read()");
8586
fprintf(outfile, "%d\n", opt);
8687

8788
fclose(outfile);

0 commit comments

Comments
 (0)