diff options
| author | Patrick Steinhardt <ps@pks.im> | 2024-10-02 12:56:19 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-10-02 07:53:55 -0700 |
| commit | 2d5dbb37b284e3ca78137ec0f8a3d9ceef78877c (patch) | |
| tree | debe5c06871bcf2648fd5de1d018d31d1df9ce67 /reftable/block.h | |
| parent | cd6a47167e068812735950b841c7174cd7cd321e (diff) | |
| download | git-2d5dbb37b284e3ca78137ec0f8a3d9ceef78877c.tar.xz | |
reftable/block: handle allocation failures
Handle allocation failures in `block_writer_init()` and
`block_reader_init()`. This requires us to bubble up error codes into
`writer_reinit_block_writer()`. Adapt call sites accordingly.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reftable/block.h')
| -rw-r--r-- | reftable/block.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/reftable/block.h b/reftable/block.h index 1c8f25ee6e..18d7ea0337 100644 --- a/reftable/block.h +++ b/reftable/block.h @@ -45,8 +45,8 @@ struct block_writer { /* * initializes the blockwriter to write `typ` entries, using `buf` as temporary * storage. `buf` is not owned by the block_writer. */ -void block_writer_init(struct block_writer *bw, uint8_t typ, uint8_t *buf, - uint32_t block_size, uint32_t header_off, int hash_size); +int block_writer_init(struct block_writer *bw, uint8_t typ, uint8_t *buf, + uint32_t block_size, uint32_t header_off, int hash_size); /* returns the block type (eg. 'r' for ref records. */ uint8_t block_writer_type(struct block_writer *bw); |
