(main): When failing to truncate, mention both the seek block count
authorJim Meyering <jim@meyering.net>
Fri, 16 Sep 2005 09:35:47 +0000 (09:35 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 16 Sep 2005 09:35:47 +0000 (09:35 +0000)
and the block size, in case the block size is very large.

src/dd.c

index 2b99f76b506ab2ad15d24a16a85ea07e33d89e44..c47249abb1d2fafe2625703d1a5b88204d8d87c4 100644 (file)
--- a/src/dd.c
+++ b/src/dd.c
@@ -1654,7 +1654,11 @@ main (int argc, char **argv)
          uintmax_t size = seek_records * output_blocksize;
 
          if (OFF_T_MAX / output_blocksize < seek_records)
-           error (EXIT_FAILURE, EOVERFLOW, "seek=%"PRIuMAX"", seek_records);
+           error (EXIT_FAILURE, 0,
+                  _("offset too large: "
+                    "cannot truncate to a length of seek=%"PRIuMAX""
+                    " (%lu-byte) blocks"),
+                  seek_records, output_blocksize);
 
          if (ftruncate (STDOUT_FILENO, size) != 0)
            {