summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/driver/tpax_driver_ctx.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/driver/tpax_driver_ctx.c b/src/driver/tpax_driver_ctx.c
index b1393d2..6bb7545 100644
--- a/src/driver/tpax_driver_ctx.c
+++ b/src/driver/tpax_driver_ctx.c
@@ -242,6 +242,22 @@ static int tpax_driver_usage_block_size_range(
return TPAX_USAGE;
}
+static int tpax_driver_usage_block_constraints(
+ int fdout,
+ const char * program,
+ const char * arg,
+ struct argv_meta * meta)
+{
+ tpax_dprintf(
+ fdout,
+ "%s: usage error: the specified block size `%s' is not a multiple of 512 bytes.\n",
+ program,arg);
+
+ argv_free(meta);
+
+ return TPAX_USAGE;
+}
+
static int tpax_driver_error_archive_path(
int fdout,
const char * program,
@@ -480,6 +496,12 @@ int tpax_lib_get_driver_ctx(
fdctx->fderr,
program,entry->arg,
optv,meta);
+
+ if (cctx.blksize % 512)
+ return tpax_driver_usage_block_constraints(
+ fdctx->fderr,
+ program,entry->arg,
+ meta);
break;
case TAG_RECURSE: