From 9c1558b25d84a1ba470a0a3c0bd570d8fe387fd6 Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 23 May 2020 00:21:57 -0400 Subject: driver: write mode enabled, initial integration of tpax_archive_append(). --- src/driver/tpax_amain.c | 7 +++++-- src/driver/tpax_driver_ctx.c | 4 ---- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'src') 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); -- cgit v1.2.3