mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-09-09 09:14:57 +00:00
virsocket: Don't preserve errno in virSocketRecvFD()
When setting O_CLOEXEC flag on received FD fails the FD is closed using VIR_FORCE_CLOSE(). But the call is wrapped in errno save which is not necessary because VIR_FORCE_CLOSE() preserves errno value. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
247e8fcc6a
commit
9f33a6dcb4
@ -477,9 +477,7 @@ virSocketRecvFD(int sock, int fdflags)
|
||||
/* set close-on-exec flag */
|
||||
if (!MSG_CMSG_CLOEXEC && (fdflags & O_CLOEXEC)) {
|
||||
if (virSetCloseExec(fd) < 0) {
|
||||
int saved_errno = errno;
|
||||
VIR_FORCE_CLOSE(fd);
|
||||
errno = saved_errno;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user