From: Pádraig Brady Date: Mon, 3 Nov 2025 13:00:32 +0000 (+0000) Subject: date: avoid a duplicated write error diagnotic X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cb0ab4ef394c37c4f874f150db7f75f3ba617dd4;p=thirdparty%2Fcoreutils.git date: avoid a duplicated write error diagnotic * src/show-date.c (show_date): Only show the fprintftime() diagnostic if a further diagnostic will not be shown. --- diff --git a/src/show-date.c b/src/show-date.c index 96cefc8108..ff1470e8e0 100644 --- a/src/show-date.c +++ b/src/show-date.c @@ -31,7 +31,8 @@ show_date (char const *format, struct timespec when, timezone_t tz) if (fprintftime (stdout, format, &tm, tz, when.tv_nsec) < 0) { - error (0, errno, _("fprintftime error")); + if (! ferror (stdout)) /* otherwise it will be diagnosed later. */ + error (0, errno, _("fprintftime error")); return false; }