Skip to content

Commit 17ec27f

Browse files
pks-tgitster
authored andcommitted
reftable/stack: don't call fsync(3p) unless provided
Users of the reftable library are expected to provide their own function callback in cases they want to sync(3p) data to disk via the reftable write options. But if no such function was provided we end up calling fsync(3p) directly, which may not even be available on some systems. Drop the call to fsync(3p) and rely on the callback function exclusively. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent d38683d commit 17ec27f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

reftable/stack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static int stack_fsync(const struct reftable_write_options *opts, int fd)
3333
{
3434
if (opts->fsync)
3535
return opts->fsync(fd);
36-
return fsync(fd);
36+
return 0;
3737
}
3838

3939
static ssize_t reftable_write_data(int fd, const void *data, size_t size)

0 commit comments

Comments
 (0)