From 57c0381269abd5e2e3228d0c59d14c8bdce59a0c Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Tue, 24 Nov 2020 16:02:58 +0100 Subject: [PATCH] send_stats_to_secmod: silence coverity Signed-off-by: Nikos Mavrogiannopoulos --- src/worker-vpn.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/worker-vpn.c b/src/worker-vpn.c index cfd080d3..001d8e5a 100644 --- a/src/worker-vpn.c +++ b/src/worker-vpn.c @@ -529,8 +529,13 @@ void send_stats_to_secmod(worker_st * ws, time_t now, unsigned discon_reason) ret = send_msg_to_secmod(ws, sd, CMD_SEC_CLI_STATS, &msg, (pack_size_func)cli_stats_msg__get_packed_size, (pack_func) cli_stats_msg__pack); - if (discon_reason) /* wait for sec-mod to close connection to verify data have been accounted */ - (void)read(sd, buf, sizeof(buf)); + if (discon_reason) { /* wait for sec-mod to close connection to verify data have been accounted */ + e = read(sd, buf, sizeof(buf)); + if (e == -1) { + e = errno; + oclog(ws, LOG_DEBUG, "could not wait for sec-mod: %s\n", strerror(e)); + } + } close(sd); if (ret >= 0) {