diff --git a/dev/src/uu_chmod/chmod.rs.html b/dev/src/uu_chmod/chmod.rs.html index f8ae64751..d220e3435 100644 --- a/dev/src/uu_chmod/chmod.rs.html +++ b/dev/src/uu_chmod/chmod.rs.html @@ -375,6 +375,9 @@ 375 376 377 +378 +379 +380
// This file is part of the uutils coreutils package.
//
// (c) Alex Lyon <arcterus@mail.com>
@@ -389,12 +392,12 @@
use std::os::unix::fs::{MetadataExt, PermissionsExt};
use std::path::Path;
use uucore::display::Quotable;
-use uucore::error::{ExitCode, UResult, USimpleError, UUsageError};
+use uucore::error::{set_exit_code, ExitCode, UResult, USimpleError, UUsageError};
use uucore::fs::display_permissions_unix;
use uucore::libc::mode_t;
#[cfg(not(windows))]
use uucore::mode;
-use uucore::{format_usage, show_error};
+use uucore::{format_usage, show, show_error};
const ABOUT: &str = "Change the mode of each FILE to MODE.\n\
With --reference, change the mode of each FILE to that of RFILE.";
@@ -572,21 +575,24 @@
filename.quote()
);
if !self.quiet {
- return Err(USimpleError::new(
+ show!(USimpleError::new(
1,
format!("cannot operate on dangling symlink {}", filename.quote()),
));
}
} else if !self.quiet {
- return Err(USimpleError::new(
+ show!(USimpleError::new(
1,
format!(
"cannot access {}: No such file or directory",
filename.quote()
- ),
+ )
));
}
- return Err(ExitCode::new(1));
+ // GNU exits with exit code 1 even if -q or --quiet are passed
+ // So we set the exit code, because it hasn't been set yet if `self.quiet` is true.
+ set_exit_code(1);
+ continue;
}
if self.recursive && self.preserve_root && filename == "/" {
return Err(USimpleError::new(
diff --git a/dev/uu_chmod/index.html b/dev/uu_chmod/index.html
index 3bfc94e48..5786b8cf1 100644
--- a/dev/uu_chmod/index.html
+++ b/dev/uu_chmod/index.html
@@ -1 +1 @@
-uu_chmod - Rust
\ No newline at end of file
+uu_chmod - Rust
\ No newline at end of file