logo

utils-std

Collection of commonly available Unix tools
commit: aa722e3e2a83f557c89dbe3226455ced003567a1
parent 8dc4a888009e259ab650eb282248bfe81e2dc715
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Wed,  1 May 2024 00:04:17 +0200

Improve new_mode error handling message a bit

Diffstat:

Mcmd/chmod.c2+-
Mcmd/mkdir.c2+-
Mcmd/mkfifo.c2+-
Mcmd/mknod.c2+-
Mtest-cmd/chmod2+-
5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/cmd/chmod.c b/cmd/chmod.c @@ -42,7 +42,7 @@ do_fchmodat(int fd, char *mode_arg, char *name, char *acc_path, bool recursive) mode_t mode = new_mode(mode_arg, stats.st_mode, &errstr); if(errstr != NULL) { - fprintf(stderr, "chmod: Failed parsing '%s': %s\n", mode_arg, errstr); + fprintf(stderr, "chmod: Failed parsing mode '%s': %s\n", mode_arg, errstr); return 1; } diff --git a/cmd/mkdir.c b/cmd/mkdir.c @@ -115,7 +115,7 @@ main(int argc, char *argv[]) mode = new_mode(optarg, 0777, &errstr); if(errstr != NULL) { - fprintf(stderr, "mkdir: Failed parsing '%s': %s\n", optarg, errstr); + fprintf(stderr, "mkdir: Failed parsing mode '%s': %s\n", optarg, errstr); return 1; } break; diff --git a/cmd/mkfifo.c b/cmd/mkfifo.c @@ -38,7 +38,7 @@ main(int argc, char *argv[]) mode = new_mode(optarg, 0666, &errstr); if(errstr != NULL) { - fprintf(stderr, "mkfifo: Failed parsing '%s': %s\n", optarg, errstr); + fprintf(stderr, "mkfifo: Failed parsing mode '%s': %s\n", optarg, errstr); return 1; } break; diff --git a/cmd/mknod.c b/cmd/mknod.c @@ -63,7 +63,7 @@ main(int argc, char *argv[]) mode = new_mode(optarg, 0666, &errstr); if(errstr != NULL) { - fprintf(stderr, "mknod: Failed parsing '%s': %s\n", optarg, errstr); + fprintf(stderr, "mknod: Failed parsing mode '%s': %s\n", optarg, errstr); return 1; } break; diff --git a/test-cmd/chmod b/test-cmd/chmod @@ -14,7 +14,7 @@ octal_body() { atf_check -o "inline:chmod: Permissions changed from 00000/---------- to 00444/-r--r--r-- for '${TMPDIR}/chmod_octal'\n" ../cmd/chmod -v 0444 "${TMPDIR}/chmod_octal" atf_check -o "inline:chmod: Permissions changed from 00444/-r--r--r-- to 00777/-rwxrwxrwx for '${TMPDIR}/chmod_octal'\n" ../cmd/chmod -v 0777 "${TMPDIR}/chmod_octal" - atf_check -s not-exit:0 -e "inline:chmod: Failed parsing '0888': contains digit outside of [0-7]\n" ../cmd/chmod -v 0888 "${TMPDIR}/chmod_octal" + atf_check -s not-exit:0 -e "inline:chmod: Failed parsing mode '0888': contains digit outside of [0-7]\n" ../cmd/chmod -v 0888 "${TMPDIR}/chmod_octal" } octal_cleanup() { atf_check chmod u=rw "${TMPDIR}/chmod_octal"