mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-01 17:35:19 +00:00
virtio-device: add a safety comment for a dup(2) call
Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
parent
9b3cab8c72
commit
32af6f9723
@ -488,6 +488,7 @@ impl Net {
|
||||
|
||||
for fd in fds.iter() {
|
||||
// Duplicate so that it can survive reboots
|
||||
// SAFETY: FFI call to dup. Trivially safe.
|
||||
let fd = unsafe { libc::dup(*fd) };
|
||||
if fd < 0 {
|
||||
return Err(Error::DuplicateTapFd(std::io::Error::last_os_error()));
|
||||
|
Loading…
x
Reference in New Issue
Block a user