mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 12:14:48 +00:00
agent/rustjail: remove makedev function
remove `makedev` function, use `nix`'s implementation instead Signed-off-by: Julio Montes <julio.montes@intel.com>
This commit is contained in:
parent
b99fefad7e
commit
98cc979ae1
@ -724,10 +724,6 @@ fn ensure_ptmx() -> Result<()> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn makedev(major: u64, minor: u64) -> u64 {
|
|
||||||
(minor & 0xff) | ((major & 0xfff) << 8) | ((minor & !0xff) << 12) | ((major & !0xfff) << 32)
|
|
||||||
}
|
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
static ref LINUXDEVICETYPE: HashMap<&'static str, SFlag> = {
|
static ref LINUXDEVICETYPE: HashMap<&'static str, SFlag> = {
|
||||||
let mut m = HashMap::new();
|
let mut m = HashMap::new();
|
||||||
@ -748,7 +744,7 @@ fn mknod_dev(dev: &LinuxDevice) -> Result<()> {
|
|||||||
&dev.path[1..],
|
&dev.path[1..],
|
||||||
*f,
|
*f,
|
||||||
Mode::from_bits_truncate(dev.file_mode.unwrap_or(0)),
|
Mode::from_bits_truncate(dev.file_mode.unwrap_or(0)),
|
||||||
makedev(dev.major as u64, dev.minor as u64),
|
nix::sys::stat::makedev(dev.major as u64, dev.minor as u64),
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
unistd::chown(
|
unistd::chown(
|
||||||
|
Loading…
Reference in New Issue
Block a user