Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
agent/rustjail: remove makedev function
remove `makedev` function, use `nix`'s implementation instead

Signed-off-by: Julio Montes <julio.montes@intel.com>
  • Loading branch information
Julio Montes committed Sep 21, 2020
1 parent b99fefa commit 98cc979
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/agent/rustjail/src/mount.rs
Expand Up @@ -724,10 +724,6 @@ fn ensure_ptmx() -> Result<()> {
Ok(())
}

fn makedev(major: u64, minor: u64) -> u64 {
(minor & 0xff) | ((major & 0xfff) << 8) | ((minor & !0xff) << 12) | ((major & !0xfff) << 32)
}

lazy_static! {
static ref LINUXDEVICETYPE: HashMap<&'static str, SFlag> = {
let mut m = HashMap::new();
Expand All @@ -748,7 +744,7 @@ fn mknod_dev(dev: &LinuxDevice) -> Result<()> {
&dev.path[1..],
*f,
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(
Expand Down

0 comments on commit 98cc979

Please sign in to comment.