From 21b066a58e38b808953919636819aaf0f18ff740 Mon Sep 17 00:00:00 2001 From: Pat Laster Date: Thu, 13 Oct 2022 17:40:27 -0500 Subject: [PATCH] Why is S_IWUSR showing up as a u16 on macos --- src/uu/rm/src/rm.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/uu/rm/src/rm.rs b/src/uu/rm/src/rm.rs index fa4d8cc35..b17ea2d63 100644 --- a/src/uu/rm/src/rm.rs +++ b/src/uu/rm/src/rm.rs @@ -558,7 +558,8 @@ fn handle_writable_directory(path: &Path, options: &Options, metadata: &Metadata use std::os::unix::fs::PermissionsExt; let mode = metadata.permissions().mode(); // Check if directory has user write permissions - let user_writable = (mode & libc::S_IWUSR) != 0; + // Why is S_IWUSR showing up as a u16 on macos? + let user_writable = (mode & (libc::S_IWUSR as u32)) != 0; if !user_writable { prompt(&(format!("remove write-protected directory {}? ", path.quote()))) } else if options.interactive == InteractiveMode::Always {