]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11903: Fix errors reported by PVS-Studio Static Code Analyzer for switch_apr.c
authorAndrey Volk <andywolk@gmail.com>
Fri, 12 Jul 2019 16:31:23 +0000 (20:31 +0400)
committerAndrey Volk <andywolk@gmail.com>
Mon, 15 Jul 2019 19:41:10 +0000 (23:41 +0400)
src/switch_apr.c

index f6a8d56ea6e0672035cad4f0accd3ab6a6672531..8337d0e5a4d3c580575a8aed601cc359ce9a7b6d 100644 (file)
@@ -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;
        }