mirror of
https://github.com/uutils/coreutils
synced 2025-01-07 10:49:09 +00:00
uucore: modify are_hardlinks_to_same_file to check only immediate metadata
This commit is contained in:
parent
a6e5f5d640
commit
c113284a4b
1 changed files with 2 additions and 2 deletions
|
@ -635,12 +635,12 @@ pub fn are_hardlinks_to_same_file(_source: &Path, _target: &Path) -> bool {
|
||||||
/// * `bool` - Returns `true` if the paths are hard links to the same file, and `false` otherwise.
|
/// * `bool` - Returns `true` if the paths are hard links to the same file, and `false` otherwise.
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
pub fn are_hardlinks_to_same_file(source: &Path, target: &Path) -> bool {
|
pub fn are_hardlinks_to_same_file(source: &Path, target: &Path) -> bool {
|
||||||
let source_metadata = match fs::metadata(source) {
|
let source_metadata = match fs::symlink_metadata(source) {
|
||||||
Ok(metadata) => metadata,
|
Ok(metadata) => metadata,
|
||||||
Err(_) => return false,
|
Err(_) => return false,
|
||||||
};
|
};
|
||||||
|
|
||||||
let target_metadata = match fs::metadata(target) {
|
let target_metadata = match fs::symlink_metadata(target) {
|
||||||
Ok(metadata) => metadata,
|
Ok(metadata) => metadata,
|
||||||
Err(_) => return false,
|
Err(_) => return false,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue