From: Pádraig Brady Date: Sun, 13 Aug 2017 07:18:43 +0000 (-0700) Subject: seq: produce consistent error messages upon write error X-Git-Tag: v8.28~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae150112846275604688f723ed0960309b289eec;p=thirdparty%2Fcoreutils.git seq: produce consistent error messages upon write error * 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 --- diff --git a/src/seq.c b/src/seq.c index bb191ba696..5e5b38129b 100644 --- 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 diff --git a/tests/misc/seq-epipe.sh b/tests/misc/seq-epipe.sh index edbd563295..69dd75d6a3 100755 --- a/tests/misc/seq-epipe.sh +++ b/tests/misc/seq-epipe.sh @@ -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; }