From a1ee5cd714c0825b0244d09bbaa0a61c883ac18f Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 4 Jan 2013 22:45:34 +0100 Subject: maint: improve error messages upon failed read, write, access, close Note we use "failed to {access,close}" for those single operations, and "error {read,writ}ing" for those partial operation failures. * src/copy.c: Improve error messages for failing read, write and close. * src/cp.c: Improve error messages for failing access. * src/dd.c: Improve error messages for failing read, write and open. * src/head.c: Improve error message for failing close. * src/install.c: Improve error messages for failing access. * src/ln.c: Likewise. * src/mv.c: Likewise. * src/touch.c: Improve error message for failing close. * src/truncate.c: Likewise. --- src/cp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/cp.c') diff --git a/src/cp.c b/src/cp.c index 0d64f9f5e..e235b326d 100644 --- a/src/cp.c +++ b/src/cp.c @@ -567,7 +567,7 @@ target_directory_operand (char const *file, struct stat *st, bool *new_dst) if (err) { if (err != ENOENT) - error (EXIT_FAILURE, err, _("accessing %s"), quote (file)); + error (EXIT_FAILURE, err, _("failed to access %s"), quote (file)); *new_dst = true; } return is_a_dir; @@ -1066,7 +1066,8 @@ main (int argc, char **argv) { struct stat st; if (stat (optarg, &st) != 0) - error (EXIT_FAILURE, errno, _("accessing %s"), quote (optarg)); + error (EXIT_FAILURE, errno, _("failed to access %s"), + quote (optarg)); if (! S_ISDIR (st.st_mode)) error (EXIT_FAILURE, 0, _("target %s is not a directory"), quote (optarg)); -- cgit v1.2.3-54-g00ecf