Directly check the return value of 'connect'. Unfortunately we can't
remove it as we have to undo auto-closing of the socket on success.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
return -1;
}
- ret = connect(monfd, (struct sockaddr *) &addr, sizeof(addr));
- if (ret < 0) {
+ if (connect(monfd, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
virReportSystemError(errno, "%s",
_("failed to connect to monitor socket"));
return -1;