]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
uniq: be more specific when diagnosing read errors
authorPádraig Brady <P@draigBrady.com>
Wed, 26 Apr 2023 14:20:47 +0000 (15:20 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 26 Apr 2023 15:19:51 +0000 (16:19 +0100)
* src/uniq.c (check_file): Use the errno when diagnosing read errors.

src/uniq.c

index ad0c1d6ae30ba5f2e7242f2ed4595b45158982ac..9044bde8783b6e4e9f0d9f357f3dad8d68ade5c5 100644 (file)
@@ -459,7 +459,7 @@ check_file (char const *infile, char const *outfile, char delimiter)
 
  closefiles:
   if (ferror (stdin) || fclose (stdin) != 0)
-    die (EXIT_FAILURE, 0, _("error reading %s"), quoteaf (infile));
+    die (EXIT_FAILURE, errno, _("error reading %s"), quoteaf (infile));
 
   /* stdout is handled via the atexit-invoked close_stdout function.  */