From 74958794c6619f6cc1cf00f5c0834cea5a253017 Mon Sep 17 00:00:00 2001 From: Michael Debertol Date: Mon, 16 Aug 2021 00:18:45 +0200 Subject: [PATCH] chmod: print change message to stdout, not stderr --- src/uu/chmod/src/chmod.rs | 4 ++-- tests/by-util/test_chmod.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/uu/chmod/src/chmod.rs b/src/uu/chmod/src/chmod.rs index bdcafc435..874c78dea 100644 --- a/src/uu/chmod/src/chmod.rs +++ b/src/uu/chmod/src/chmod.rs @@ -322,7 +322,7 @@ impl Chmoder { show_error!("{}", err); } if self.verbose { - show_error!( + println!( "failed to change mode of file '{}' from {:04o} ({}) to {:04o} ({})", file.display(), fperm, @@ -334,7 +334,7 @@ impl Chmoder { Err(1) } else { if self.verbose || self.changes { - show_error!( + println!( "mode of '{}' changed from {:04o} ({}) to {:04o} ({})", file.display(), fperm, diff --git a/tests/by-util/test_chmod.rs b/tests/by-util/test_chmod.rs index 5031105f9..f0973c712 100644 --- a/tests/by-util/test_chmod.rs +++ b/tests/by-util/test_chmod.rs @@ -330,8 +330,8 @@ fn test_chmod_recursive() { .arg("a") .arg("z") .succeeds() - .stderr_contains(&"to 0333 (-wx-wx-wx)") - .stderr_contains(&"to 0222 (-w--w--w-)"); + .stdout_contains(&"to 0333 (-wx-wx-wx)") + .stdout_contains(&"to 0222 (-w--w--w-)"); assert_eq!(at.metadata("z/y").permissions().mode(), 0o100222); assert_eq!(at.metadata("a/a").permissions().mode(), 0o100222);