Remove unnecessary integer suffix

This commit is contained in:
B. Blechschmidt 2023-04-10 20:48:01 +02:00
parent c0cff1da58
commit b669b9de22

View file

@ -173,7 +173,7 @@ impl Setup {
let fd = nix::fcntl::open( let fd = nix::fcntl::open(
"/tmp/tun2proxy-resolv.conf", "/tmp/tun2proxy-resolv.conf",
nix::fcntl::OFlag::O_RDWR | nix::fcntl::OFlag::O_CLOEXEC | nix::fcntl::OFlag::O_CREAT, nix::fcntl::OFlag::O_RDWR | nix::fcntl::OFlag::O_CLOEXEC | nix::fcntl::OFlag::O_CREAT,
nix::sys::stat::Mode::from_bits(0o644_u32).unwrap(), nix::sys::stat::Mode::from_bits(0o644).unwrap(),
)?; )?;
let data = "nameserver 198.18.0.1\n".as_bytes(); let data = "nameserver 198.18.0.1\n".as_bytes();
let mut written = 0; let mut written = 0;
@ -183,7 +183,7 @@ impl Setup {
} }
written += nix::unistd::write(fd, &data[written..])?; written += nix::unistd::write(fd, &data[written..])?;
} }
nix::sys::stat::fchmod(fd, nix::sys::stat::Mode::from_bits(0o444_u32).unwrap())?; nix::sys::stat::fchmod(fd, nix::sys::stat::Mode::from_bits(0o444).unwrap())?;
let source = format!("/proc/self/fd/{}", fd); let source = format!("/proc/self/fd/{}", fd);
nix::mount::mount( nix::mount::mount(
source.as_str().into(), source.as_str().into(),