summaryrefslogtreecommitdiff
path: root/src/driver
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2020-05-23 00:21:57 -0400
committermidipix <writeonce@midipix.org>2020-05-23 05:59:02 +0000
commit9c1558b25d84a1ba470a0a3c0bd570d8fe387fd6 (patch)
tree67b42104b4b66f7f47f0225528063f2736d65c01 /src/driver
parent409008f8960e24f5f2b25a84642cbb0c043f0ab9 (diff)
downloadtpax-9c1558b25d84a1ba470a0a3c0bd570d8fe387fd6.tar.bz2
tpax-9c1558b25d84a1ba470a0a3c0bd570d8fe387fd6.tar.xz
driver: write mode enabled, initial integration of tpax_archive_append().
Diffstat (limited to 'src/driver')
-rw-r--r--src/driver/tpax_amain.c7
-rw-r--r--src/driver/tpax_driver_ctx.c4
2 files changed, 5 insertions, 6 deletions
diff --git a/src/driver/tpax_amain.c b/src/driver/tpax_amain.c
index 84b15f4..d94eaf0 100644
--- a/src/driver/tpax_amain.c
+++ b/src/driver/tpax_amain.c
@@ -52,8 +52,8 @@ static void tpax_perform_unit_actions(
const struct tpax_driver_ctx * dctx,
struct tpax_unit_ctx * uctx)
{
- (void)dctx;
- (void)uctx;
+ if (dctx->cctx->drvflags & TPAX_DRIVER_EXEC_MODE_WRITE)
+ tpax_archive_append(dctx,uctx);
}
static int tpax_exit(struct tpax_driver_ctx * dctx, int ret)
@@ -91,5 +91,8 @@ int tpax_main(char ** argv, char ** envp, const struct tpax_fd_ctx * fdctx)
}
}
+ if ((dctx->cctx->drvflags & TPAX_DRIVER_EXEC_MODE_WRITE) && dctx->units[0])
+ tpax_archive_seal(dctx);
+
return tpax_exit(dctx,dctx->errv[0] ? TPAX_ERROR : TPAX_OK);
}
diff --git a/src/driver/tpax_driver_ctx.c b/src/driver/tpax_driver_ctx.c
index 926eb07..4f533cc 100644
--- a/src/driver/tpax_driver_ctx.c
+++ b/src/driver/tpax_driver_ctx.c
@@ -487,10 +487,6 @@ int tpax_get_driver_ctx(
return tpax_driver_error_not_implemented(
fdctx->fderr,program,"read mode",meta);
- case TPAX_DRIVER_EXEC_MODE_WRITE:
- return tpax_driver_error_not_implemented(
- fdctx->fderr,program,"write mode",meta);
-
case TPAX_DRIVER_EXEC_MODE_COPY:
close(fddst);