summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-12-20 20:10:48 +0000
committerJim Meyering <jim@meyering.net>2002-12-20 20:10:48 +0000
commitf331e1389c93765fafd3b9553762612b0c351304 (patch)
tree1b4c0433cc16c1c487c9bd101e9922d294a675ba /src
parent5fcf19366eee1b523745c5d0ebef8b172b7eac67 (diff)
downloadcoreutils-f331e1389c93765fafd3b9553762612b0c351304.tar.xz
(touch): Change the wording of a diagnostic so
that it makes sense both when the file exists and when it doesn't.
Diffstat (limited to 'src')
-rw-r--r--src/touch.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/touch.c b/src/touch.c
index 645357082..faec81911 100644
--- a/src/touch.c
+++ b/src/touch.c
@@ -214,7 +214,13 @@ touch (const char *file)
if (status)
{
if (open_errno)
- error (0, open_errno, _("creating %s"), quote (file));
+ {
+ /* The wording of this diagnostic should cover at least two cases:
+ - the file does not exist, but the parent directory is unwritable
+ - the file exists, but it isn't writable
+ I think it's not worth trying to distinguish them. */
+ error (0, open_errno, _("cannot touch %s"), quote (file));
+ }
else
{
if (no_create && errno == ENOENT)