Address code review comments

See #12502
This commit is contained in:
Johannes Altmanninger
2026-03-12 17:20:29 +08:00
parent eb7ea0ef9b
commit 888e6d97f9
2 changed files with 3 additions and 5 deletions

View File

@@ -119,8 +119,7 @@ fn print_rusage_self() {
let usage = getrusage(UsageWho::RUSAGE_SELF).unwrap();
let rss_kb = if cfg!(apple) {
// Macs use bytes,
// Source: commit b6555a0dc462f669e1b5a370c3efae0f5948a1ef
// The docs at https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/getrusage.2.html say otherwise.
// even though docs at https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/getrusage.2.html say otherwise.
usage.max_rss() / 1024
} else {
usage.max_rss()

View File

@@ -80,9 +80,8 @@ fn set_umask(list_val: &[WString]) -> EnvStackSetResult {
return EnvStackSetResult::Invalid;
}
// Do not actually create a umask variable. On env_stack_t::get() it will be calculated.
// We already checked that `mask` is in range 0..=0o777, so it does not really matter which
// variant of `Mode::from_bits` we use.
umask(Mode::from_bits_truncate(mask as libc::mode_t));
// We already checked that `mask` is in range 0..=0o777.
umask(Mode::from_bits(mask as libc::mode_t).unwrap());
EnvStackSetResult::Ok
}