mirror of
https://git.proxmox.com/git/proxmox
synced 2025-10-04 10:43:57 +00:00
sys: replace CStr::from_bytes_... with c"literals"
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
ba304a4f83
commit
dd36fec23d
@ -117,11 +117,7 @@ fn create_path_do(
|
||||
Some(Component::Prefix(_)) => bail!("illegal prefix path component encountered"),
|
||||
Some(Component::RootDir) => {
|
||||
let _ = iter.next();
|
||||
crate::fd::open(
|
||||
unsafe { CStr::from_bytes_with_nul_unchecked(b"/\0") },
|
||||
OFlag::O_DIRECTORY,
|
||||
stat::Mode::empty(),
|
||||
)?
|
||||
crate::fd::open(c"/", OFlag::O_DIRECTORY, stat::Mode::empty())?
|
||||
}
|
||||
Some(Component::CurDir) => {
|
||||
let _ = iter.next();
|
||||
@ -129,11 +125,7 @@ fn create_path_do(
|
||||
}
|
||||
Some(Component::ParentDir) => {
|
||||
let _ = iter.next();
|
||||
crate::fd::open(
|
||||
unsafe { CStr::from_bytes_with_nul_unchecked(b"..\0") },
|
||||
OFlag::O_DIRECTORY,
|
||||
stat::Mode::empty(),
|
||||
)?
|
||||
crate::fd::open(c"..", OFlag::O_DIRECTORY, stat::Mode::empty())?
|
||||
}
|
||||
Some(Component::Normal(_)) => {
|
||||
// simply do not advance the iterator, heavy lifting happens in create_path_at_do()
|
||||
@ -159,12 +151,7 @@ fn create_path_at_do(
|
||||
None => return Ok(created),
|
||||
|
||||
Some(Component::ParentDir) => {
|
||||
at = crate::fd::openat(
|
||||
&at,
|
||||
unsafe { CStr::from_bytes_with_nul_unchecked(b"..\0") },
|
||||
OFlag::O_DIRECTORY,
|
||||
stat::Mode::empty(),
|
||||
)?;
|
||||
at = crate::fd::openat(&at, c"..", OFlag::O_DIRECTORY, stat::Mode::empty())?;
|
||||
}
|
||||
|
||||
Some(Component::Normal(path)) => {
|
||||
|
Loading…
Reference in New Issue
Block a user