]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
seq: produce consistent error messages upon write error
authorPádraig Brady <P@draigBrady.com>
Sun, 13 Aug 2017 07:18:43 +0000 (00:18 -0700)
committerPádraig Brady <P@draigBrady.com>
Mon, 14 Aug 2017 04:31:57 +0000 (21:31 -0700)
* src/seq.c (io_error): Use the same error message as would
be generated at exit time when closing the stdout stream.
The inconsistency was added with commit v8.25-26-gc92585b.
This was noticed due to an inconsistency in the expected
error message generated by seq on musl libc.
Addresses https://bugs.gnu.org/28054

src/seq.c
tests/misc/seq-epipe.sh

index bb191ba6968aa1b4934f2109baae43a86c6a903e..5e5b38129be299766faba2e520977093f3ed6641 100644 (file)
--- a/src/seq.c
+++ b/src/seq.c
@@ -284,7 +284,7 @@ io_error (void)
 {
   /* FIXME: consider option to silently ignore errno=EPIPE */
   clearerr (stdout);
-  die (EXIT_FAILURE, errno, _("standard output"));
+  die (EXIT_FAILURE, errno, _("write error"));
 }
 
 /* Actually print the sequence of numbers in the specified range, with the
index edbd5632951902536ba5a3b6e828a2b31571c08c..69dd75d6a3741b1bfd18d4f7ad9dde8bfc403cdb 100755 (executable)
@@ -33,7 +33,7 @@ compare exp code || fail=1
 
 # The error message must begin with "standard output:"
 # (but don't hard-code the strerror text)
-grep '^seq: standard output: ' err \
+grep '^seq: write error: ' err \
   || { warn_ "seq emitted incorrect error on EPIPE"; \
        cat err;\
        fail=1; }