diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/vcl/vcom.c | 3 | ||||
-rw-r--r-- | src/vcl/vcom_socket.c | 16 | ||||
-rw-r--r-- | src/vcl/vcom_socket_wrapper.c | 5 |
3 files changed, 12 insertions, 12 deletions
diff --git a/src/vcl/vcom.c b/src/vcl/vcom.c index 6d98fdb75c0..9bd5e0e54a2 100644 --- a/src/vcl/vcom.c +++ b/src/vcl/vcom.c @@ -1282,8 +1282,7 @@ vcom_select (int __nfds, fd_set * __restrict __readfds, * */ vcom_fd_set_merge ( /* dest, select sets */ - __readfds || __writefds || __exceptfds ? - &new_nfds : NULL, + &new_nfds, __readfds, __writefds, __exceptfds, diff --git a/src/vcl/vcom_socket.c b/src/vcl/vcom_socket.c index 8806ebd011a..1ccb05451ad 100644 --- a/src/vcl/vcom_socket.c +++ b/src/vcl/vcom_socket.c @@ -465,6 +465,7 @@ vcom_socket_read (int __fd, void *__buf, size_t __nbytes) { rv = vppcom_session_read (vsock->sid, __buf, __nbytes); } + /* coverity[CONSTANT_EXPRESSION_RESULT] */ while (rv == -EAGAIN || rv == -EWOULDBLOCK); return rv; } @@ -535,6 +536,7 @@ vcom_socket_readv (int __fd, const struct iovec * __iov, int __iovcnt) } } } + /* coverity[CONSTANT_EXPRESSION_RESULT] */ while ((rv == -EAGAIN || rv == -EWOULDBLOCK) && total == 0); return total; } @@ -1561,7 +1563,8 @@ vcom_socket_sendto (int __fd, const void *__buf, size_t __n, return -EDESTADDRREQ; } /* not a vppcom supported address family */ - if ((__addr->sa_family != AF_INET) || (__addr->sa_family != AF_INET6)) + if (!((__addr->sa_family == AF_INET) || + (__addr->sa_family == AF_INET6))) { return -EINVAL; } @@ -3151,13 +3154,9 @@ vcom_socket_poll_vppcom_impl (struct pollfd *__fds, nfds_t __nfds, { time_to_wait = (double) 0; } - else if (__timeout < 0) - { - time_to_wait = ~0; - } else { - return -EBADF; + time_to_wait = ~0; } return vppcom_poll (__fds, __nfds, time_to_wait); @@ -3332,9 +3331,10 @@ vcom_socket_main_destroy (void) /* *INDENT-OFF* */ pool_flush (vepitem, vsm->vepitems, ({ - if (vepitem->type == FD_TYPE_EPOLL || FD_TYPE_VCOM_SOCKET) + if ((vepitem->type == FD_TYPE_EPOLL) || + (vepitem->type == FD_TYPE_VCOM_SOCKET)) { - vcom_socket_epoll_ctl1 (vepitem->epfd, EPOLL_CTL_DEL, + vcom_socket_epoll_ctl1 (vepitem->epfd, EPOLL_CTL_DEL, vepitem->fd, NULL); vepitem_init (vepitem); } diff --git a/src/vcl/vcom_socket_wrapper.c b/src/vcl/vcom_socket_wrapper.c index 19a775de99e..8d546929218 100644 --- a/src/vcl/vcom_socket_wrapper.c +++ b/src/vcl/vcom_socket_wrapper.c @@ -101,6 +101,8 @@ static pthread_mutex_t libc_symbol_binding_mutex = PTHREAD_MUTEX_INITIALIZER; #ifdef NDEBUG #define SWRAP_LOG(...) #else +static unsigned int swrap_log_lvl = SWRAP_LOG_WARN; + static void swrap_log (enum swrap_dbglvl_e dbglvl, const char *func, const char *format, ...) @@ -113,13 +115,12 @@ PRINTF_ATTRIBUTE (3, 4); { char buffer[1024]; va_list va; - unsigned int lvl = SWRAP_LOG_WARN; va_start (va, format); vsnprintf (buffer, sizeof (buffer), format, va); va_end (va); - if (lvl >= dbglvl) + if (dbglvl <= swrap_log_lvl) { switch (dbglvl) { |