| 15 | #include "progress.h" |
| 16 | |
| 17 | static void verify_buffer_or_die(struct hashfile *f, |
| 18 | const void *buf, |
| 19 | unsigned int count) |
| 20 | { |
| 21 | ssize_t ret = read_in_full(f->check_fd, f->check_buffer, count); |
| 22 | |
| 23 | if (ret < 0) |
| 24 | die_errno("%s: sha1 file read error", f->name); |
| 25 | if ((size_t)ret != count) |
| 26 | die("%s: sha1 file truncated", f->name); |
| 27 | if (memcmp(buf, f->check_buffer, count)) |
| 28 | die("sha1 file '%s' validation error", f->name); |
| 29 | } |
| 30 | |
| 31 | static void flush(struct hashfile *f, const void *buf, unsigned int count) |
| 32 | { |
no test coverage detected