mirror of
https://github.com/uutils/coreutils
synced 2024-12-13 23:02:38 +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.
|
||||
#[cfg(unix)]
|
||||
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,
|
||||
Err(_) => return false,
|
||||
};
|
||||
|
||||
let target_metadata = match fs::metadata(target) {
|
||||
let target_metadata = match fs::symlink_metadata(target) {
|
||||
Ok(metadata) => metadata,
|
||||
Err(_) => return false,
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue