1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-01 13:37:48 +00:00

touch/gnu compat: when touch fails because of a permission error, change the error message

+ return 1 as error code when having this error
This commit is contained in:
Sylvestre Ledru 2021-06-02 22:53:10 +02:00
parent e7f5916864
commit eb2c06c37e
2 changed files with 30 additions and 4 deletions

View file

@ -449,3 +449,13 @@ fn test_touch_mtime_dst_fails() {
ucmd.args(&["-m", "-t", &s, file]).fails();
}
}
#[test]
#[cfg(unix)]
fn test_touch_system_fails() {
let (_at, mut ucmd) = at_and_ucmd!();
let file = "/";
ucmd.args(&[file])
.fails()
.stderr_contains("setting times of '/'");
}