diff --git a/src/chmod/chmod.rs b/src/chmod/chmod.rs index 15b34f299..6faf93b6b 100644 --- a/src/chmod/chmod.rs +++ b/src/chmod/chmod.rs @@ -145,7 +145,7 @@ fn verify_mode(mode: &str) -> Result<(), String> { Ok(()) } -fn chmod(files: Vec, changes: bool, quiet: bool, verbose: bool, preserve_root: bool, recursive: bool, fmode: Option, cmode: Option<&String>) -> Result<(), int> { +fn chmod(files: Vec, changes: bool, quiet: bool, verbose: bool, preserve_root: bool, recursive: bool, fmode: Option, cmode: Option<&String>) -> Result<(), int> { let mut r = Ok(()); for filename in files.iter() { @@ -181,7 +181,7 @@ fn chmod(files: Vec, changes: bool, quiet: bool, verbose: bool, preserve r } -fn chmod_file(file: &Path, name: &str, changes: bool, quiet: bool, verbose: bool, fmode: Option, cmode: Option<&String>) -> Result<(), int> { +fn chmod_file(file: &Path, name: &str, changes: bool, quiet: bool, verbose: bool, fmode: Option, cmode: Option<&String>) -> Result<(), int> { let path = name.to_c_str(); match fmode { Some(mode) => { @@ -279,7 +279,7 @@ fn chmod_file(file: &Path, name: &str, changes: bool, quiet: bool, verbose: bool '+' | '-' | '=' => (ch, change.slice_from(1)), _ => ('=', change) }; - let mode = from_str_radix::(slice, 8).unwrap(); // already verified + let mode = from_str_radix::(slice, 8).unwrap() as libc::mode_t; // already verified match action { '+' => fperm |= mode, '-' => fperm &= !mode,