mirror of
https://github.com/uutils/coreutils.git
synced 2025-12-23 08:47:37 +00:00
du: simplify signature of Stat::new_from_dirfd
This commit is contained in:
parent
83574316e7
commit
def1bb2b87
1 changed files with 2 additions and 6 deletions
|
|
@ -166,11 +166,7 @@ impl Stat {
|
|||
|
||||
/// Create a Stat using safe traversal methods with `DirFd` for the root directory
|
||||
#[cfg(target_os = "linux")]
|
||||
fn new_from_dirfd(
|
||||
dir_fd: &DirFd,
|
||||
full_path: &Path,
|
||||
_options: &TraversalOptions,
|
||||
) -> std::io::Result<Self> {
|
||||
fn new_from_dirfd(dir_fd: &DirFd, full_path: &Path) -> std::io::Result<Self> {
|
||||
// Get metadata for the directory itself using fstat
|
||||
let safe_metadata = dir_fd.metadata()?;
|
||||
|
||||
|
|
@ -361,7 +357,7 @@ fn safe_du(
|
|||
Err(_e) => {
|
||||
// Try using our new DirFd method for the root directory
|
||||
match DirFd::open(path) {
|
||||
Ok(dir_fd) => match Stat::new_from_dirfd(&dir_fd, path, options) {
|
||||
Ok(dir_fd) => match Stat::new_from_dirfd(&dir_fd, path) {
|
||||
Ok(s) => s,
|
||||
Err(e) => {
|
||||
let error = e.map_err_context(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue