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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user