Fix ignoring the number of bytes read, warning reported by Coverity
tool:
CID 258286 (#1 of 1): Ignoring number of bytes read (CHECKED_RETURN).
check_return: read(int, void *, size_t) returns the number of bytes
read, but it is ignored.
In cgre_receive_unix_domain_msg(), the number of bytes read() is
ignored, while reading from the flag value of the pid. Coverity warns on
not checking the number of bytes read, fix it.
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
(cherry picked from commit
ed283eab173addd3b5c2dd666de8f3086125e106)
strerror(errno));
return;
}
- if (read(fd_client, &pid, sizeof(pid)) < 0) {
+ ret_len = read(fd_client, &pid, sizeof(pid));
+ if (ret_len != sizeof(pid)) {
flog(LOG_WARNING, "Warning: 'read' command error: %s\n",
strerror(errno));
goto close;