From: Bart Van Assche Date: Sun, 12 Jan 2020 00:31:14 +0000 (-0800) Subject: server: Make it explicit that the setsockopt() return value is ignored X-Git-Tag: fio-3.18~12^2~3 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=affc8edfe90306d12fad8fddd474c52b6ba14a0a;p=fio.git 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 --- 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) {