Commit 91dc09a6 authored by Guenter Roeck's avatar Guenter Roeck Committed by Jakub Kicinski
Browse files

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: c65b5bb2 ("selftests: net: add passive TFO test binary")
Cc: David Wei <dw@davidwei.uk>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Link: https://patch.msgid.link/20251205171010.515236-14-linux@roeck-us.net


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 59546e87
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -81,7 +81,8 @@ static void run_server(void)
	if (getsockopt(connfd, SOL_SOCKET, SO_INCOMING_NAPI_ID, &opt, &len) < 0)
		error(1, errno, "getsockopt(SO_INCOMING_NAPI_ID)");

	read(connfd, buf, 64);
	if (read(connfd, buf, 64) < 0)
		perror("read()");
	fprintf(outfile, "%d\n", opt);

	fclose(outfile);