Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit83aa296

Browse files
committed
chore(cp): remove code duplication
1 parent9d862cc commit83aa296

File tree

1 file changed

+7
-32
lines changed

1 file changed

+7
-32
lines changed

‎src/uu/cp/src/cp.rs

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2523,38 +2523,13 @@ fn handle_no_preserve_mode(options: &Options, org_mode: u32) -> u32 {
25232523
S_IRGRP,S_IROTH,S_IRUSR,S_IRWXG,S_IRWXO,S_IRWXU,S_IWGRP,S_IWOTH,S_IWUSR,
25242524
};
25252525

2526-
#[cfg(not(any(
2527-
target_os ="android",
2528-
target_os ="macos",
2529-
target_os ="freebsd",
2530-
target_os ="redox",
2531-
)))]
2532-
{
2533-
constMODE_RW_UGO:u32 =S_IRUSR |S_IWUSR |S_IRGRP |S_IWGRP |S_IROTH |S_IWOTH;
2534-
constS_IRWXUGO:u32 =S_IRWXU |S_IRWXG |S_IRWXO;
2535-
returnif is_explicit_no_preserve_mode{
2536-
MODE_RW_UGO
2537-
}else{
2538-
org_mode&S_IRWXUGO
2539-
};
2540-
}
2541-
2542-
#[cfg(any(
2543-
target_os ="android",
2544-
target_os ="macos",
2545-
target_os ="freebsd",
2546-
target_os ="redox",
2547-
))]
2548-
{
2549-
constMODE_RW_UGO:u32 =
2550-
(S_IRUSR |S_IWUSR |S_IRGRP |S_IWGRP |S_IROTH |S_IWOTH)asu32;
2551-
constS_IRWXUGO:u32 =(S_IRWXU |S_IRWXG |S_IRWXO)asu32;
2552-
returnif is_explicit_no_preserve_mode{
2553-
MODE_RW_UGO
2554-
}else{
2555-
org_mode&S_IRWXUGO
2556-
};
2557-
}
2526+
constMODE_RW_UGO:u32 =S_IRUSR |S_IWUSR |S_IRGRP |S_IWGRP |S_IROTH |S_IWOTH;
2527+
constS_IRWXUGO:u32 =S_IRWXU |S_IRWXG |S_IRWXO;
2528+
returnif is_explicit_no_preserve_mode{
2529+
MODE_RW_UGO
2530+
}else{
2531+
org_mode&S_IRWXUGO
2532+
};
25582533
}
25592534

25602535
org_mode

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp