Skip to content

Commit

Permalink
simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
mitnk committed Sep 29, 2024
1 parent 4212a95 commit c973dbb
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/builtins/ulimit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,14 @@ fn set_limit(limit_name: &str, value: u64, for_hard: bool) -> String {

// to support armv7-linux-gnueabihf & 32-bit musl systems
if for_hard {
#[cfg(all(target_pointer_width = "32", not(target_env = "musl")))]
#[cfg(all(target_pointer_width = "32", target_env = "gnu"))]
{ rlp.rlim_max = value as u32; }

#[cfg(all(target_pointer_width = "32", target_env = "musl"))]
{ rlp.rlim_max = value as u64; }

#[cfg(target_pointer_width = "64")]
#[cfg(not(all(target_pointer_width = "32", target_env = "gnu")))]
{ rlp.rlim_max = value; }
} else {
#[cfg(all(target_pointer_width = "32", not(target_env = "musl")))]
#[cfg(all(target_pointer_width = "32", target_env = "gnu"))]
{ rlp.rlim_cur = value as u32; }

#[cfg(all(target_pointer_width = "32", target_env = "musl"))]
{ rlp.rlim_cur = value as u64; }

#[cfg(target_pointer_width = "64")]
#[cfg(not(all(target_pointer_width = "32", target_env = "gnu")))]
{ rlp.rlim_cur = value; }
}

Expand Down

0 comments on commit c973dbb

Please sign in to comment.