From affc8edfe90306d12fad8fddd474c52b6ba14a0a Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 11 Jan 2020 16:31:14 -0800 Subject: [PATCH] server: Make it explicit that the setsockopt() return value is ignored This patch fixes the following Coverity complaint: CID 169316 (#1 of 1): Unchecked return value from library (CHECKED_RETURN) 5. check_return: Calling setsockopt(sk, 1, 15, &opt, 4U) without checking return value. This library function may fail and return an error code. Signed-off-by: Bart Van Assche --- server.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server.c b/server.c index b7347b43..1a070e56 100644 --- a/server.c +++ b/server.c @@ -2154,7 +2154,8 @@ static int fio_init_server_ip(void) /* * Not fatal if fails, so just ignore it if that happens */ - setsockopt(sk, SOL_SOCKET, SO_REUSEPORT, &opt, sizeof(opt)); + if (setsockopt(sk, SOL_SOCKET, SO_REUSEPORT, &opt, sizeof(opt))) { + } #endif if (use_ipv6) { -- 2.25.1