1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 19:47:45 +00:00

fix freebds mode_t is u16 but other unix platforms are u32

This commit is contained in:
tommady 2023-10-04 09:12:26 +00:00
parent 6c05385d77
commit 5ce3720820
No known key found for this signature in database
GPG key ID: 175B664929DF2F2F
2 changed files with 17 additions and 5 deletions

View file

@ -1752,20 +1752,32 @@ fn copy_file(
#[cfg(not(any( #[cfg(not(any(
target_os = "android", target_os = "android",
target_os = "macos", target_os = "macos",
target_os = "macos-12" target_os = "macos-12",
target_os = "freebds",
)))] )))]
const MODE_RW_UGO: u32 = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH; const MODE_RW_UGO: u32 = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
#[cfg(not(any( #[cfg(not(any(
target_os = "android", target_os = "android",
target_os = "macos", target_os = "macos",
target_os = "macos-12" target_os = "macos-12",
target_os = "freebds",
)))] )))]
const S_IRWXUGO: u32 = S_IRWXU | S_IRWXG | S_IRWXO; const S_IRWXUGO: u32 = S_IRWXU | S_IRWXG | S_IRWXO;
#[cfg(any(target_os = "android", target_os = "macos", target_os = "macos-12"))] #[cfg(any(
target_os = "android",
target_os = "macos",
target_os = "macos-12",
target_os = "freebds",
))]
const MODE_RW_UGO: u32 = const MODE_RW_UGO: u32 =
(S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) as u32; (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) as u32;
#[cfg(any(target_os = "android", target_os = "macos", target_os = "macos-12"))] #[cfg(any(
target_os = "android",
target_os = "macos",
target_os = "macos-12",
target_os = "freebds",
))]
const S_IRWXUGO: u32 = (S_IRWXU | S_IRWXG | S_IRWXO) as u32; const S_IRWXUGO: u32 = (S_IRWXU | S_IRWXG | S_IRWXO) as u32;
match is_explicit_no_preserve_mode { match is_explicit_no_preserve_mode {

View file

@ -1553,7 +1553,7 @@ fn test_cp_preserve_links_case_7() {
} }
#[test] #[test]
#[cfg(all(unix, not(target_os = "freebsd")))] #[cfg(all(unix))]
fn test_cp_no_preserve_mode_case() { fn test_cp_no_preserve_mode_case() {
use libc::umask; use libc::umask;
use uucore::fs as uufs; use uucore::fs as uufs;