diff options
| author | Patrick Steinhardt <ps@pks.im> | 2023-12-11 10:07:34 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-12-11 07:23:16 -0800 |
| commit | 917a2b3ce990717ccce5ff372766d9ffd41239f6 (patch) | |
| tree | a9f8fe27ce529fa1da78c4f959815b7465ef70ec /reftable/blocksource.c | |
| parent | e32b8ece640fc700c5a74dd53e6cae8b1a893a6d (diff) | |
| download | git-917a2b3ce990717ccce5ff372766d9ffd41239f6.tar.xz | |
reftable: handle interrupted reads
There are calls to pread(3P) and read(3P) where we don't properly handle
interrupts. Convert them to use `pread_in_full()` and `read_in_full()`,
respectively.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reftable/blocksource.c')
| -rw-r--r-- | reftable/blocksource.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/reftable/blocksource.c b/reftable/blocksource.c index 8331b34e82..a1ea304429 100644 --- a/reftable/blocksource.c +++ b/reftable/blocksource.c @@ -109,7 +109,7 @@ static int file_read_block(void *v, struct reftable_block *dest, uint64_t off, struct file_block_source *b = v; assert(off + size <= b->size); dest->data = reftable_malloc(size); - if (pread(b->fd, dest->data, size, off) != size) + if (pread_in_full(b->fd, dest->data, size, off) != size) return -1; dest->len = size; return size; |
