diff options
| author | Pádraig Brady <P@draigBrady.com> | 2021-03-15 13:08:26 +0000 |
|---|---|---|
| committer | Pádraig Brady <P@draigBrady.com> | 2021-03-15 13:12:29 +0000 |
| commit | 86c8dc2e85c0941ec7908cd5a3db7803e7293606 (patch) | |
| tree | 9958cbcd0c25dd728d97a8864760d9bfc008464f /src | |
| parent | cksum: add --debug to diagnose which implementation used (diff) | |
| download | coreutils-86c8dc2e85c0941ec7908cd5a3db7803e7293606.tar.gz coreutils-86c8dc2e85c0941ec7908cd5a3db7803e7293606.zip | |
cksum: don't exit immediately if a single file overflows
This behavior was introduced in commit FILEUTILS-4_0_44-4-g519b707b4.
* src/cksum.c (cksum_slice8): Only report the overflow, and continue.
* src/cksum_pclmul.c (cksum_pclmul): Likewise.
Diffstat (limited to 'src')
| -rw-r--r-- | src/cksum.c | 5 | ||||
| -rw-r--r-- | src/cksum_pclmul.c | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/cksum.c b/src/cksum.c index f3d41666b..8b8b9b190 100644 --- a/src/cksum.c +++ b/src/cksum.c @@ -226,7 +226,10 @@ cksum_slice8 (FILE *fp, const char *file, uint_fast32_t *crc_out, uint32_t second = 0; if (length + bytes_read < length) - die (EXIT_FAILURE, 0, _("%s: file too long"), quotef (file)); + { + error (0, EOVERFLOW, _("%s: file too long"), quotef (file)); + return false; + } length += bytes_read; /* Process multiples of 8 bytes */ diff --git a/src/cksum_pclmul.c b/src/cksum_pclmul.c index 9a1b760fe..e18f17ae7 100644 --- a/src/cksum_pclmul.c +++ b/src/cksum_pclmul.c @@ -21,7 +21,7 @@ #include <stdint.h> #include <x86intrin.h> #include "system.h" -#include "die.h" +#include "error.h" /* Number of bytes to read at once. */ #define BUFLEN (1 << 16) @@ -74,7 +74,10 @@ cksum_pclmul (FILE *fp, const char *file, uint_fast32_t *crc_out, __m128i xor_crc; if (length + bytes_read < length) - die (EXIT_FAILURE, 0, _("%s: file too long"), quotef (file)); + { + error (0, EOVERFLOW, _("%s: file too long"), quotef (file)); + return false; + } length += bytes_read; datap = (__m128i *)buf; |
