]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: tac: prefer "failed to" diagnostic over "cannot"
authorJim Meyering <meyering@redhat.com>
Tue, 18 Oct 2011 12:20:36 +0000 (14:20 +0200)
committerJim Meyering <meyering@redhat.com>
Wed, 19 Oct 2011 07:31:52 +0000 (09:31 +0200)
* src/tac.c: Change wording in diagnostic: "failed to open" seems
clearer than "cannot open".

src/tac.c
tests/misc/tac

index 7cc562e918d43dd9690d3dc48eccd27644fce7d4..01150a3e87b31d5f3e6ee627aa573e2d887408da 100644 (file)
--- a/src/tac.c
+++ b/src/tac.c
@@ -449,7 +449,7 @@ temp_stream (FILE **fp, char **file_name)
       int fd = mkstemp (tempfile);
       if (fd < 0)
         {
-          error (0, errno, _("cannot create temporary file in %s"),
+          error (0, errno, _("failed to create temporary file in %s"),
                  quote (tempdir));
           goto Reset;
         }
@@ -457,7 +457,8 @@ temp_stream (FILE **fp, char **file_name)
       tmp_fp = fdopen (fd, (O_BINARY ? "w+b" : "w+"));
       if (! tmp_fp)
         {
-          error (0, errno, _("cannot open %s for writing"), quote (tempfile));
+          error (0, errno, _("failed to open %s for writing"),
+                 quote (tempfile));
           close (fd);
           unlink (tempfile);
         Reset:
@@ -569,7 +570,8 @@ tac_file (const char *filename)
       fd = open (filename, O_RDONLY | O_BINARY);
       if (fd < 0)
         {
-          error (0, errno, _("cannot open %s for reading"), quote (filename));
+          error (0, errno, _("failed to open %s for reading"),
+                 quote (filename));
           return false;
         }
     }
index 7bd07bd8af0510ad33499a69f206eeb664e4ab6e..56021280bb1b9887723757b88e77c2bb52058a94 100755 (executable)
@@ -68,7 +68,7 @@ my @Tests =
    {ENV => "TMPDIR=$bad_dir"},
    {IN_PIPE => "a\n"},
    {ERR_SUBST => "s,`$bad_dir': .*,...,"},
-   {ERR => "$prog: cannot create temporary file in ...\n"},
+   {ERR => "$prog: failed to create temporary file in ...\n"},
    {EXIT => 1}],
 
   # coreutils-8.5's tac would double-free its primary buffer.