mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: modify or provide safety comments
Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
@@ -1784,6 +1784,7 @@ impl DeviceManager {
|
||||
// SAFETY: The following pair are safe because termios gets totally overwritten by tcgetattr
|
||||
// and we check the return result.
|
||||
let mut termios: termios = unsafe { zeroed() };
|
||||
// SAFETY: see above
|
||||
let ret = unsafe { tcgetattr(fd, &mut termios as *mut _) };
|
||||
if ret < 0 {
|
||||
return vmm_sys_util::errno::errno_result();
|
||||
|
||||
Reference in New Issue
Block a user