mirror of
https://github.com/utmapp/qemu.git
synced 2026-12-01 22:23:23 -10: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 <[email protected]> CC: [email protected] CC: [email protected] CC: Eric Blake <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
This commit is contained in:
1 parent
fd56356422
commit
7e6478e7d4
1 file changed
+3
-1
+3
-1
@@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in new issue
Block a user