Skip to content

Commit 55e6354

Browse files
Switch out libc::renameat for libc::renameat2 and consolidate musl/glibc
1 parent b96a88d commit 55e6354

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

src/devices/src/virtio/fs/linux/overlayfs.rs

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1996,24 +1996,15 @@ impl OverlayFs {
19961996

19971997
// Perform the rename
19981998
let res = unsafe {
1999-
#[cfg(target_env = "gnu")]
1999+
#[cfg(any(target_env = "gnu", target_env = "musl"))]
20002000
{
2001-
libc::renameat2(
2002-
old_parent_data.file.as_raw_fd(),
2003-
old_name.as_ptr(),
2004-
new_parent_data.file.as_raw_fd(),
2005-
new_name.as_ptr(),
2006-
flags,
2007-
)
2008-
}
2009-
#[cfg(target_env = "musl")]
2010-
{
2011-
libc::renameat(
2012-
old_parent_data.file.as_raw_fd(),
2013-
old_name.as_ptr(),
2014-
new_parent_data.file.as_raw_fd(),
2015-
new_name.as_ptr(),
2016-
)
2001+
libc::renameat2(
2002+
old_parent_data.file.as_raw_fd(),
2003+
old_name.as_ptr(),
2004+
new_parent_data.file.as_raw_fd(),
2005+
new_name.as_ptr(),
2006+
flags,
2007+
)
20172008
}
20182009
};
20192010

0 commit comments

Comments
 (0)