FS-11903: Fix errors reported by PVS-Studio Static Code Analyzer for switch_apr.c

This commit is contained in:
Andrey Volk 2019-07-12 20:31:23 +04:00
parent fa40e64916
commit 594203f9b1
1 changed files with 4 additions and 8 deletions

View 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;
}