mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
coverity: validate descriptor
Since this function is called with 'fd == -1', but Coverity can't see this path can't be visited with this argument, add explicit check for valid descriptor.
This commit is contained in:
parent
f331eb1c0d
commit
26c58027fb
@ -1999,6 +1999,9 @@ static int send_message(void *buf, int msglen, const char *csid, int fd,
|
||||
return clops->cluster_send_message(buf, msglen, csid, errtext);
|
||||
}
|
||||
|
||||
if (fd < 0)
|
||||
return 0;
|
||||
|
||||
/* Make sure it all goes */
|
||||
for (ptr = 0; ptr < msglen;) {
|
||||
if ((len = write(fd, (char*)buf + ptr, msglen - ptr)) <= 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user