mirror of
https://github.com/git/git.git
synced 2026-01-10 10:13:33 +00:00
reftable/writer: handle allocation failures in reftable_new_writer()
Handle allocation failures in `reftable_new_writer()`. Adapt the function to return an error code to return such failures. While at it, rename it to match our code style as we have to touch up every callsite anyway. 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
b680af2dba
commit
74d1c18757
@@ -90,11 +90,13 @@ struct reftable_stats {
|
||||
int object_id_len;
|
||||
};
|
||||
|
||||
/* reftable_new_writer creates a new writer */
|
||||
struct reftable_writer *
|
||||
reftable_new_writer(ssize_t (*writer_func)(void *, const void *, size_t),
|
||||
int (*flush_func)(void *),
|
||||
void *writer_arg, const struct reftable_write_options *opts);
|
||||
struct reftable_writer;
|
||||
|
||||
/* Create a new writer. */
|
||||
int reftable_writer_new(struct reftable_writer **out,
|
||||
ssize_t (*writer_func)(void *, const void *, size_t),
|
||||
int (*flush_func)(void *),
|
||||
void *writer_arg, const struct reftable_write_options *opts);
|
||||
|
||||
/* Set the range of update indices for the records we will add. When writing a
|
||||
table into a stack, the min should be at least
|
||||
|
||||
Reference in New Issue
Block a user