mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
Check the return value of fcntl in qemu_set_cloexec
Assert that the return value is not an error. This issue was found by Coverity. CID: 1374831 Signed-off-by: Stefano Stabellini <sstabellini@kernel.org> CC: groug@kaod.org CC: pbonzini@redhat.com CC: Eric Blake <eblake@redhat.com> Message-Id: <1494356693-13190-2-git-send-email-sstabellini@kernel.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
fd56356422
commit
7e6478e7d4
1 changed files with 3 additions and 1 deletions
|
@ -182,7 +182,9 @@ void qemu_set_cloexec(int fd)
|
|||
{
|
||||
int f;
|
||||
f = fcntl(fd, F_GETFD);
|
||||
fcntl(fd, F_SETFD, f | FD_CLOEXEC);
|
||||
assert(f != -1);
|
||||
f = fcntl(fd, F_SETFD, f | FD_CLOEXEC);
|
||||
assert(f != -1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue