From: Paul Eggert Date: Tue, 28 Mar 2023 08:52:43 +0000 (-0700) Subject: date: diagnose -f read errors X-Git-Tag: v9.3~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c5e542fd190a14431092e3b6cb45d18fe95f26f;p=thirdparty%2Fcoreutils.git date: diagnose -f read errors * src/date.c (batch_convert): Diagnose read errors, fixing Bug#62497. --- diff --git a/src/date.c b/src/date.c index 0f2012761d..bc4cc0ce95 100644 --- a/src/date.c +++ b/src/date.c @@ -368,7 +368,9 @@ batch_convert (char const *input_filename, char const *format, ssize_t line_length = getline (&line, &buflen, in_stream); if (line_length < 0) { - /* FIXME: detect/handle error here. */ + if (ferror (in_stream)) + die (EXIT_FAILURE, errno, _("%s: read error"), + quotef (input_filename)); break; }