summaryrefslogtreecommitdiffstats
path: root/src/vcl/vcom_socket_wrapper.c
diff options
context:
space:
mode:
authorDave Wallace <dwallacelf@gmail.com>2017-10-24 20:47:45 -0400
committerDave Wallace <dwallacelf@gmail.com>2017-10-24 20:47:45 -0400
commit60f54822b78dea6b87cde5da82a4a135e7c2b960 (patch)
tree66e5cba28eb2f670bf88ebe9ce89e83a71922782 /src/vcl/vcom_socket_wrapper.c
parent5c7cf1cc5358d137160be1619981e7eea9a7402f (diff)
VCL-LDPRELOAD: Fix coverity warnings.
- CID 178225: Constant expression result - CID 178220: Logically dead code - CID 178222: Logically dead code - CID 178227: Logically dead code - CID 178223: Same on both sides - CID 178226: Same on both sides Change-Id: Ie0c80edb41390cf2308e54938be85d865e292138 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Diffstat (limited to 'src/vcl/vcom_socket_wrapper.c')
-rw-r--r--src/vcl/vcom_socket_wrapper.c5
1 files changed, 3 insertions, 2 deletions
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)
{