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>
This commit is contained in:

committed by
Junio C Hamano

parent
cd6a47167e
commit
2d5dbb37b2
@ -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);
|
||||
|
Reference in New Issue
Block a user