1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-20 02:36:16 +02:00

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.
This commit is contained in:
Pádraig Brady
2025-11-03 13:00:32 +00:00
parent d870bfbca1
commit cb0ab4ef39

View File

@@ -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;
}