send_stats_to_secmod: silence coverity

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
This commit is contained in:
Nikos Mavrogiannopoulos
2020-11-24 16:02:58 +01:00
parent 56c6ab9cbf
commit 57c0381269

View File

@@ -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) {