From 594203f9b14630c0857c80311820e2c323873f97 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Fri, 12 Jul 2019 20:31:23 +0400 Subject: [PATCH] FS-11903: Fix errors reported by PVS-Studio Static Code Analyzer for switch_apr.c --- src/switch_apr.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/switch_apr.c b/src/switch_apr.c index f6a8d56ea6..8337d0e5a4 100644 --- a/src/switch_apr.c +++ b/src/switch_apr.c @@ -841,11 +841,9 @@ SWITCH_DECLARE(switch_status_t) switch_socket_opt_set(switch_socket_t *sock, int #if defined(TCP_KEEPIDLE) r = setsockopt(sock->socketdes, SOL_TCP, TCP_KEEPIDLE, (void *)&on, sizeof(on)); +#else + return SWITCH_STATUS_NOTIMPL; #endif - if (r == -10) { - return SWITCH_STATUS_NOTIMPL; - } - return r ? SWITCH_STATUS_FALSE : SWITCH_STATUS_SUCCESS; } @@ -855,12 +853,10 @@ SWITCH_DECLARE(switch_status_t) switch_socket_opt_set(switch_socket_t *sock, int #if defined(TCP_KEEPINTVL) r = setsockopt(sock->socketdes, SOL_TCP, TCP_KEEPINTVL, (void *)&on, sizeof(on)); +#else + return SWITCH_STATUS_NOTIMPL; #endif - if (r == -10) { - return SWITCH_STATUS_NOTIMPL; - } - return r ? SWITCH_STATUS_FALSE : SWITCH_STATUS_SUCCESS; }