From b0b10001fe6345dd4037aef5c93e4c65b3306eec Mon Sep 17 00:00:00 2001 From: Andy Green Date: Mon, 19 Mar 2018 08:21:49 +0800 Subject: [PATCH] coverity 188318: try to hide fake unused var from coverity --- lib/server/server.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/server/server.c b/lib/server/server.c index 616ac737..0b8710b6 100644 --- a/lib/server/server.c +++ b/lib/server/server.c @@ -34,6 +34,9 @@ lws_context_init_server(struct lws_context_creation_info *info, { #if LWS_POSIX int n, opt = 1, limit = 1; +#if defined(__linux__) && defined(SO_REUSEPORT) + int n1; +#endif #endif lws_sockfd_type sockfd; struct lws_vhost *vh; @@ -132,10 +135,13 @@ lws_context_init_server(struct lws_context_creation_info *info, #endif #if defined(__linux__) && defined(SO_REUSEPORT) - n = lws_check_opt(vhost->options, + n1 = lws_check_opt(vhost->options, LWS_SERVER_OPTION_ALLOW_LISTEN_SHARE); + /* keep coverity happy */ #if LWS_MAX_SMP > 1 n = 1; +#else + n = n1; #endif if (n && vhost->context->count_threads > 1) if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEPORT,