summaryrefslogtreecommitdiffhomepage
path: root/src/logic
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-07-16 20:14:40 +0000
committermidipix <writeonce@midipix.org>2024-07-16 20:14:40 +0000
commita749fdfc3615246713808529cc1ab7e947040ec7 (patch)
treec1c74a4f1f72fe59b2fce60eec25a64f9c4968ff /src/logic
parenteba861e4ed34d46cd7925b4075d00f0f556afc2b (diff)
downloadtpax-a749fdfc3615246713808529cc1ab7e947040ec7.tar.bz2
tpax-a749fdfc3615246713808529cc1ab7e947040ec7.tar.xz
library api's: _meta_ namespace: make header creation interfaces context independent.
Diffstat (limited to 'src/logic')
-rw-r--r--src/logic/tpax_archive_write.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/logic/tpax_archive_write.c b/src/logic/tpax_archive_write.c
index a881bd9..f01bb7b 100644
--- a/src/logic/tpax_archive_write.c
+++ b/src/logic/tpax_archive_write.c
@@ -110,6 +110,7 @@ static int tpax_archive_write_impl(
int fdcwd,
int fdout)
{
+ int ret;
struct tpax_unit_ctx * uctx;
struct tpax_ustar_header uhdr;
const struct stat * st;
@@ -210,9 +211,14 @@ static int tpax_archive_write_impl(
dpos = hpos + sizeof(uhdr);
/* header */
- if (tpax_meta_init_ustar_header(
- dctx,apath,st,
- slnk,&uhdr) < 0)
+ if (dctx->cctx->drvflags & TPAX_DRIVER_WRITE_FORMAT_RUSTAR) {
+ ret = tpax_meta_init_rustar_header(apath,st,slnk,&uhdr);
+
+ } else if (dctx->cctx->drvflags & TPAX_DRIVER_WRITE_FORMAT_USTAR) {
+ ret = tpax_meta_init_ustar_header(apath,st,slnk,&uhdr);
+ }
+
+ if (ret < 0)
return tpax_archive_write_ret(
TPAX_NESTED_ERROR(dctx),
dctx,uctx);