mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-22 04:25:21 +00:00
vmm: Fix clippy on musl toolchains
The datatype used for the ioctl() C library call is different between it and the glibc toolchains. The easiest solution is to have the compiler type cast to type of the parameter. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
a1c6ef8385
commit
b3e3a5fdd7
@ -62,7 +62,6 @@ use pci::{
|
||||
use seccompiler::SeccompAction;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::{BTreeSet, HashMap};
|
||||
use std::convert::TryInto;
|
||||
use std::fs::{read_link, File, OpenOptions};
|
||||
use std::io::{self, stdout, Seek, SeekFrom};
|
||||
use std::mem::zeroed;
|
||||
@ -504,19 +503,13 @@ pub fn create_pty() -> io::Result<(File, File, PathBuf)> {
|
||||
};
|
||||
let mut unlock: libc::c_ulong = 0;
|
||||
// SAFETY: FFI call into libc, trivially safe
|
||||
unsafe {
|
||||
libc::ioctl(
|
||||
main.as_raw_fd(),
|
||||
TIOCSPTLCK.try_into().unwrap(),
|
||||
&mut unlock,
|
||||
)
|
||||
};
|
||||
unsafe { libc::ioctl(main.as_raw_fd(), TIOCSPTLCK as _, &mut unlock) };
|
||||
|
||||
// SAFETY: FFI call into libc, trivally safe
|
||||
let sub_fd = unsafe {
|
||||
libc::ioctl(
|
||||
main.as_raw_fd(),
|
||||
TIOCGTPEER.try_into().unwrap(),
|
||||
TIOCGTPEER as _,
|
||||
libc::O_NOCTTY | libc::O_RDWR,
|
||||
)
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user