]> git.ipfire.org Git - thirdparty/git.git/commit
reftable/system: provide thin wrapper for tempfile subsystem
authorPatrick Steinhardt <ps@pks.im>
Mon, 18 Nov 2024 15:34:03 +0000 (16:34 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 19 Nov 2024 03:23:10 +0000 (12:23 +0900)
commit01e49941d6560dfebfac39a2ffe49d3d24b35069
tree584b67606909ee2d719248513221f3975b9ab10e
parent86b770b0bbf1aba3c8e43401936258c58648703a
reftable/system: provide thin wrapper for tempfile subsystem

We use the tempfile subsystem to write temporary tables, but given that
we're in the process of converting the reftable library to become
standalone we cannot use this subsystem directly anymore. While we could
in theory convert the code to use mkstemp(3p) instead, we'd lose access
to our infrastructure that automatically prunes tempfiles via atexit(3p)
or signal handlers.

Provide a thin wrapper for the tempfile subsystem instead. Like this,
the compatibility shim is fully self-contained in "reftable/system.c".
Downstream users of the reftable library would have to implement their
own tempfile shims by replacing "system.c" with a custom version.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
reftable/stack.c
reftable/system.c [new file with mode: 0644]
reftable/system.h